fs_fclose()

int  fs_fclose (FS_FILE  *p_file);

File

Called from

Code enabled by

fs_api.c

Application

FS_CFG_API_EN

Close and free a file.

Arguments

p_file

Pointer to a file.

Returned Value

0, if the file was successfully closed.

FS_EOF, otherwise.

Notes/Warnings

  1. After a file is closed, the application must desist from accessing its file pointer. This could cause file system corruption, since this handle may be re-used for a different file.
  2. If the most recent operation is output (write), all unwritten data is written to the file.
  3. Any buffer assigned with fs_setbuf() or fs_setvbuf() shall no longer be accessed by the file system and may be re-used by the application.