FSfread Function

Microchip MDD File System Interface

MDDFS Interface Library Help
FSfread Function
C
size_t FSfread(
    void * ptr, 
    size_t size, 
    size_t n, 
    FSFILE * stream
);
Description

The FSfread function will read data from the specified file. First, the appropriate sector of the file is loaded. Then, data is read into the specified buffer until the specified number of bytes have been read. When a cluster boundary is reached, a new cluster will be loaded. The parameters 'size' and 'n' indicate how much data to read. 'Size' refers to the size of one object to read (in bytes), and 'n' will refer to the number of these objects to read. The value returned will be equal to 'n' unless an error occured or the user tried to read beyond the end of the file.

Preconditions

File is opened in a read mode

Parameters
Parameters 
Description 
ptr 
Destination buffer for read bytes 
size 
Size of units in bytes 
Number of units to be read 
stream 
File to be read from 
Returns

size_t - number of units read

Side Effects

The FSerrno variable will be changed.

Remarks

None.

Microchip MDD File System Interface 1.2.0 - [Aug 18, 2008]
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.