FSfseek Function

MDD File System Interface Library

MDDFS Interface Library Help
FSfseek Function
C
int FSfseek(
    FSFILE * stream, 
    long offset, 
    int whence
);
Description

The FSfseek function will change the current position in the file to one specified by the user. First, an absolute offset is calculated using the offset and base location passed in by the user. Then, the position variables are updated, and the sector number that corresponds to the new location. That sector is then loaded. If the offset falls exactly on a cluster boundary, a new cluster will be allocated to the file and the position will be set to the first byte of that cluster.

Preconditions

File opened

Parameters
Parameters 
Description 
stream 
Pointer to file structure 
offset 
Offset from base location 
whence 
  • SEEK_SET - Seek from start of file
  • SEEK_CUR - Seek from current location
  • SEEK_END - Seek from end of file (subtract offset)
 
Return Values
Return Values 
Description 
Operation successful 
-1 
Operation unsuccesful 
Side Effects

The FSerrno variable will be changed.

Remarks

None

Microchip MDD File System Interface 1.4.2 - [Oct 15, 2012]
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.