[FreeRTOS+FAT Standard API Reference]
FF_FILE *ff_truncate( const char * pcFileName, long lTruncateSize );
Opens a file for writing, then truncates the file’s length to lTruncateSize.
If the file was longer than lTruncateSize then the data past lTruncateSize is discarded.
If the file was shorter than lTruncateSize then new data added to the end of the file is set to 0.
|pcFileName||A pointer to a standard null terminated C string that holds the name of the file being opened and truncated. The file name can include a relative path to the file.|
|lTruncateSize||The length, in byte, to which the file’s length will be set.|
If the length of the file was successfully set to lTruncateSize then a pointer to the opened file is returned.
If the length of the file was not successfully set to lTruncateSize then NULL is returned, the file will remain closed, and the task’s errno is set to indicate the reason. A task can obtain its errno value using the ff_errno() API function.