M2M_T_FS_HANDLE m2m_fs_truncate(CHAR *filename, UINT32 new_size)
Description: the function truncates the file by discarding the needed last bytes to obtain the new size. The truncation will be effective when you close the file after truncation.
Parameters:
filename: pointer to the zero-terminated
string containing the file name
new_size: new file size
Return
value:
on
success: pointer to the file
handle
on
failure: NULL
NOTE: m2m_fs_last_error function returns the failure reason.
Example:
M2M_T_FS_HANDLE file_handle = m2m_fs_truncate( filename, 10 );
if ( file_handle )
{
m2m_fs_close(file_handel ); /* after the closing the file is effectively truncated */
}