下载 FreeRTOS
 

出色的 RTOS & 嵌入式软件

最新资讯
简化任何设备的身份验证云连接。
利用 CoAP 设计节能型云连接 IoT 解决方案。
11.0.0 版 FreeRTOS 内核简介:
FreeRTOS 路线图和代码贡献流程。
使用 FreeRTOS 实现 OPC-UA over TSN。

ff_seteof() [FreeRTOS-Plus-FAT 标准 API 引用]

ff_stdio.h
int ff_seteof( FF_FILE *pxStream );
  将文件截断至文件当前的读/写位置。文件 须先使用 ff_fopen() 打开。 并将模式字符串设置为 “a” 或 “w”。 参数:
pxStream 待截断的文件。
返回: 如果文件截断成功,则返回零。 如果文件无法截断,则返回 FF_EOF,并设置任务的 errno 以指示原因。任务 可以使用 stdioGET_ERRNO() API 函数 获取其 errno 值。 用法示例:

void vSampleFunction( char *pcFileName, long lTruncatePosition )
{
FF_FILE *pxFile;

/* Open the file specified by the pcFileName parameter. */
pxFile = ff_fopen( pcFileName, "a" );

/* Move the current read/write position to the position specified by
the lTruncatePosition parameter. */

ff_fseek( pxFile, lTruncatePosition, FF_SEEK_SET );

/* Truncate the file so all data past the current file position is lost. */
if( ff_seteof( pxFile ) != FF_EOF )
{
/* The truncate failed. */
}

/* Finished with the file. */
ff_fclose( pxFile );
}

Example use of the ff_seteof() API function
 
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.