ff_stdio.h
int ff_seteof( FF_FILE *pxStream );
将文件截断至文件当前的读/写位置。文件
须先使用
ff_fopen() 打开。
并将模式字符串设置为 “a” 或 “w”。
参数:
返回:
如果文件截断成功,则返回零。
如果文件无法截断,则返回 FF_EOF,并设置任务的
errno 以指示原因。任务
可以使用
stdioGET_ERRNO() API 函数
获取其 errno 值。
用法示例:
void vSampleFunction( char *pcFileName, long lTruncatePosition )
{
FF_FILE *pxFile;
pxFile = ff_fopen( pcFileName, "a" );
ff_fseek( pxFile, lTruncatePosition, FF_SEEK_SET );
if( ff_seteof( pxFile ) != FF_EOF )
{
}
ff_fclose( pxFile );
}
Example use of the ff_seteof() API function
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.