FILEopen Function

Microchip MDD File System Interface

MDDFS Interface Library Help
FILEopen Function
C
CETYPE FILEopen(
    FILEOBJ fo, 
    WORD * fHandle, 
    char type
);
Description

This function will cache a directory entry in the directory specified by the dirclus parameter of hte FSFILE object 'fo.' The offset of the entry in the directory is specified by fHandle. Once the directory entry has been loaded, the first sector of the file can be loaded using the cluster value specified in the directory entry. The type argument will specify the mode the files will be opened in. This will allow this function to set the correct read/write flags for the file.

Preconditions

This function should not be called by the user.

Parameters
Parameters 
Description 
fo 
File to be opened 
fHandle 
Location of file 
type 
  • WRITE - Create a new file or replace an existing file
  • READ - Read data from an existing file
  • APPEND - Append data to an existing file

 

Return Values
Return Values 
Description 
CE_GOOD 
FILEopen successful 
CE_NOT_INIT 
Device is not yet initialized 
CE_FILE_NOT_FOUND 
Could not find the file on the device 
CE_BAD_SECTOR_READ 
A bad read of a sector occured 
Side Effects

None

Remarks

If the mode the file is being opened in is a plus mode (e.g. READ+) the flags will be modified further in the FSfopen function.

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