FreeRTOS+FAT is still in the lab
FreeRTOS+FAT is already in use in commercial products
and we encourage you to try it yourself. Be aware however that
FreeRTOS+FAT was acquired by Real Time Engineers Ltd., and is
still being documented and updated to
ensure it meets our strict quality standards.
Please use the forum for support,
or contact us directly if you have a specific business interest.
ff_stdio.h
int ff_fseek( FF_FILE *pxStream, int iOffset, int iWhence );
Moves the current read/write position of an open file to ( iWhence + iOffset ).
Parameters:
pxStream
|
The file in which the current read/write position is
being updated.
|
iOffset
|
An offset (in bytes) from the position set by the iWhence
parameter to which the file's current read/write position
will be set.
|
iWhence
|
The position within the file from which the iOffset value
is relative. Valid values for iWhence include:
Value
|
Description
|
FF_SEEK_CUR
|
The current file position.
|
FF_SEEK_END
|
The end of the file.
|
FF_SEEK_SET
|
The beginning of the file.
|
|
Returns:
On success 0 is returned.
If the read/write position could not be moved then -1 is returned and the task's
errno is set to indicate the reason. A task
can obtain its errno value use the ff_errno()
API function.
Example usage:
void vSampleFunction( char *pcFileName, char *pcBuffer )
{
FF_FILE *pxFile;
pxFile = ff_fopen( pcFileName, "r" );
if( pxFile != NULL )
{
ff_fread( pcBuffer, 1, 1, pxFile );
ff_fseek( pxFile, 0, FF_SEEK_SET );
ff_fread( pcBuffer, 1, 1, pxFile );
ff_fseek( pxFile, -1, FF_SEEK_END );
ff_fread( pcBuffer, 1, 1, pxFile );
ff_fclose( pxFile );
}
}
Example use of the ff_fseek() API function
|
|
|
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.