Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS+ Products FreeRTOS Labs Integration Services Contact / Enquiries


[FreeRTOS Embedded File System API]

int f_seteof( F_FILE *pxFileHandle );

Truncates a file to the current file read/write position. All data after the current read/write position is lost.


pxFileHandle   The handle of the file being truncated. The handle is returned by the call to f_open() originally used to open the file.

F_NO_ERROR   The file was successfully truncated.

Any other value   The file was not successfully truncated. The returned value holds the error code.

See also


Example usage:

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

    /* Open the file specified by the pcFileName parameter. */
    pxFile = f_open( pcFileName, "r+" );

    /* Move the current read/write position to the position specified by
    the lTruncatePosition parameter. */
    f_seek( pxFile, lTruncatePosition, F_SEEK_SET );

    /* Truncate the file so all data past the current file position is lost. */
    if( f_seteof( pxFile ) != F_NO_ERROR )
        /* The truncate failed. */

    /* Finished with the file. */
    f_close( pxFile );
Example use of the f_seteof() API function

[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS+ Sitemap ]    [ Main FreeRTOS Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.