[ ]
 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Homepage FreeRTOS Labs FreeRTOS+TCP FreeRTOS+FAT Contact / Enquiries


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_fread()

[FreeRTOS+FAT Standard API Reference]

ff_stdio.h
size_t ff_fread( void *pvBuffer, size_t xSize, size_t xItems, FF_FILE * pxStream );
		

Reads data from the current read/write position within an open file in the embedded FAT file system. The read/write position is incremented by the number of bytes read.

Parameters:

pvBuffer   A pointer to the buffer into which data read from the file will be placed. The buffer must be at least large enough to hold the number of bytes being read.

xSize   The size in bytes of each item being read from the file.

xItems   The number of items to read from the file. The size of each item is set by the xSize parameter.

pxStream   A pointer to the file from which the data is being read. This is the same pointer that was returned from the call to ff_fopen() used to originally open the file.

Returns:

The number of items actually read from the file is returned. The number of items read from the file will only equal the number of items read from the file when the item size is 1. The size of each item is set by the xSize parameter.

If the number of items read from the file is less than the xItems value then the task's errno is set to indicate the reason. A task can obtain its errno value using the ff_errno() API function.

Example usage:

The example provided on the ff_fopen() documentation page shows how ff_fread() is used.


[ Back to the top ]    [ About FreeRTOS ]    [ FreeRTOS Labs 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.