FSfclose Function

Microchip MDD File System Interface

MDDFS Interface Library Help
FSfclose Function
C
int FSfclose(
    FSFILE * fo
);
Description

This function will update the directory entry for the file pointed to by 'fo' with the information contained in 'fo,' including the new file size and attributes. Timestamp information will also be loaded based on the method selected by the user and written to the entry as the last modified time and date. The file entry will then be written to the device. Finally, the memory used for the specified file object will be freed from the dynamic heap or the array of FSFILE objects.

Preconditions

File opened

Parameters
Parameters 
Description 
fo 
Pointer to the file to close 
Return Values
Return Values 
Description 
File closed successfully 
EOF 
Error closing the file 
Side Effects

The FSerrno variable will be changed.

Remarks

A function to flush data to the device without closing the file can be created by removing the portion of this function that frees the memory and the line that clears the write flag.

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