NetBurner 3.5.0
PDF Version
 

Topics

 FAT File System Seek Codes
 

Macros

#define f_delvolume(drvnumber)   fm_delvolume(drvnumber)
 Un-mounts a flash card.
 
#define f_getfreespace(drivenum, pspace)   fm_getfreespace(drivenum, pspace)
 Provides information about the drive space usage.
 
#define f_chdir(dirname)   fm_chdir(dirname)
 Change the directory.
 
#define f_mkdir(dirname)   fm_mkdir(dirname)
 Makes a new directory.
 
#define f_rmdir(dirname)   fm_rmdir(dirname)
 Removes a directory.
 
#define f_findfirst(filename, find)   fm_findfirst(filename, find)
 Find the first file or subdirectory in a specified directory.
 
#define f_findnext(find)   fm_findnext(find)
 Finds the next file or subdirectory in a specified directory after a previous call to f_findfirst() or f_findnext().
 
#define f_close(filehandle)   fm_close(filehandle)
 Closes an opened file.
 
#define f_open(filename, mode)   fm_open(filename, mode)
 Opens a file in the file system.
 
#define f_read(buf, size, size_st, filehandle)   fm_read(buf, size, size_st, filehandle)
 Read data from the current position in a file.
 
#define f_write(buf, size, size_st, filehandle)   fm_write(buf, size, size_st, filehandle)
 Write data to the file at the current position.
 
#define f_seek(filehandle, offset, whence)   fm_seek(filehandle, offset, whence)
 Move the stream position of an open file.
 
#define f_rewind(filehandle)   fm_rewind(filehandle)
 Sets the file position in the open target file to the start of the file.
 
#define f_eof(filehandle)   fm_eof(filehandle)
 Check whether the current position in the open target file is the end of the file.
 
#define f_gettimedate(filename, pctime, pcdate)   fm_gettimedate(filename, pctime, pcdate)
 Get the time and date of a file or directory.
 
#define f_settimedate(filename, ctime, cdate)   fm_settimedate(filename, ctime, cdate)
 Set the time and date of a file or directory.
 
#define f_delete(filename)   fm_delete(filename)
 Deletes a file.
 

Functions

int f_enterFS (void)
 Adds a new task priority to the task list used by the file system.
 
void f_releaseFS (void)
 Removes a task priority from the task list used by the file system.
 

Detailed Description

#include< api_f.h >

The FAT32 Embedded Flash File System for Flash Cards, EFFS-FAT

Macro Definition Documentation

◆ f_chdir

#define f_chdir ( dirname)    fm_chdir(dirname)

#include <api_f.h>

Change the directory.

Parameters
dirnameThe directory to change to.
Return values
F_NO_ERRORIf able to change to the directory
!F_NO_ERRORIf unable to change to the directory
See also
f_mkdir()
f_rmdir()

◆ f_close

#define f_close ( filehandle)    fm_close(filehandle)

#include <api_f.h>

Closes an opened file.

Parameters
filehandleA handle to the file to close.
Return values
F_NO_ERRORIf able to close the file
!F_NO_ERRORIf unable to close the file

◆ f_delete

#define f_delete ( filename)    fm_delete(filename)

#include <api_f.h>

Deletes a file.

A read-only or open file cannot be deleted.

Parameters
filenameThe name of the file to be deleted.
Return values
F_NO_ERRORIf able to delete the file
!F_NO_ERRORIf unable to delete the file

◆ f_delvolume

#define f_delvolume ( drvnumber)    fm_delvolume(drvnumber)

#include <api_f.h>

Un-mounts a flash card.

Parameters
drvnumberThe drive to be un-mount.

◆ f_eof

#define f_eof ( filehandle)    fm_eof(filehandle)

#include <api_f.h>

Check whether the current position in the open target file is the end of the file.

Parameters
filehandleA handle to the file to check.
Return values
0Nothing at the end of the file
!0The end of the file, or an error

◆ f_findfirst

#define f_findfirst ( filename,
find )   fm_findfirst(filename, find)

#include <api_f.h>

Find the first file or subdirectory in a specified directory.

Note: If this is called with "*.*" and this is not the root directory, the first entry found will be ".", which is the current directory.

Parameters
filenameThe name of the file to find.
findWhere to store the found information.
Return values
F_NO_ERRORIf the file was found
!F_NO_ERRORIf the file wasn't found or there are errors
See also
f_findnext()

◆ f_findnext

#define f_findnext ( find)    fm_findnext(find)

#include <api_f.h>

Finds the next file or subdirectory in a specified directory after a previous call to f_findfirst() or f_findnext().

Note: If this is called with "*.*" and this is not the root directory, the first entry found will be ".", which is the current directory.

Parameters
findWhere to store the found information.
Return values
F_NO_ERRORIf the file was found
!F_NO_ERRORIf the file wasn't found or there are errors
See also
f_findfirst()

◆ f_getfreespace

#define f_getfreespace ( drivenum,
pspace )   fm_getfreespace(drivenum, pspace)

#include <api_f.h>

Provides information about the drive space usage.

Parameters
drivenumThe drive number to get space usage for.
pspaceThe structure to store the usage information in.
Return values
F_NO_ERRORIf able to get the drive space usage
!F_NO_ERRORIf unable to get the drive space usage

◆ f_gettimedate

#define f_gettimedate ( filename,
pctime,
pcdate )   fm_gettimedate(filename, pctime, pcdate)

#include <api_f.h>

Get the time and date of a file or directory.

Parameters
filenameThe name of the file or directory to modify.
[out]pctimeA pointer to store the creation time of the file or directory.
[out]pcdateA pointer to store the creation date of the file or directory.
Return values
F_NO_ERRORIf able to get time and date
!F_NO_ERRORIf unable to get time and date

◆ f_mkdir

#define f_mkdir ( dirname)    fm_mkdir(dirname)

#include <api_f.h>

Makes a new directory.

Parameters
dirnameThe name to use for the new directory.
Return values
F_NO_ERRORIf able to make the directory
!F_NO_ERRORIf unable to make the directory
See also
f_chdir()
f_rmdir()

◆ f_open

#define f_open ( filename,
mode )   fm_open(filename, mode)

#include <api_f.h>

Opens a file in the file system.

Parameters
filenameThe name of the file to open.
modeThe mode to open the file in. The following options are available:
  • "r": Reading. The stream is positioned at the beginning of the file.
  • "r+": Reading and writing. The stream is positioned at the beginning of the file.
  • "w": Truncate file to 0 length or create for writing. The stream is positioned at the beginning of the file.
  • "w+": Reading and writing. Create if it doesn't exist, or truncate if it does. The stream is positioned at the beginning of the file.
  • "a": Append, and create if it doesn't exist. The stream is positioned at the end of the file.
  • "a+": Reading and appending, and create if it doesn't exist. The stream is positioned at the end of the file.
Return values
F_FILE*Pointer to the file if it could be opened
0If it a file could not be opened
See also
f_close()

◆ f_read

#define f_read ( buf,
size,
size_st,
filehandle )   fm_read(buf, size, size_st, filehandle)

#include <api_f.h>

Read data from the current position in a file.

Parameters
bufA pointer where the data should be read.
sizeThe size of the items to be read.
size_stThe number of items to be read.
filehandleA handle to the file to read to.
Returns
The number of items read.

◆ f_rewind

#define f_rewind ( filehandle)    fm_rewind(filehandle)

#include <api_f.h>

Sets the file position in the open target file to the start of the file.

Parameters
filehandleA handle to the file operate on.
Return values
F_NO_ERRORIf successful
!F_NO_ERRORIf there was an error

◆ f_rmdir

#define f_rmdir ( dirname)    fm_rmdir(dirname)

#include <api_f.h>

Removes a directory.

Note: The target directory must be empty, otherwise an error code is returned.

Parameters
dirnameThe name of the directory to remove.
Return values
F_NO_ERRORIf able to remove the directory
!F_NO_ERRORIf unable to remove the directory
See also
f_chdir()
f_mkdir()

◆ f_seek

#define f_seek ( filehandle,
offset,
whence )   fm_seek(filehandle, offset, whence)

#include <api_f.h>

Move the stream position of an open file.

Parameters
filehandleA handle to the file to move the position of.
offsetThe relative byte position according to whence.
whenceWhere to calculate the offset from. Can be a value from FAT File System Seek Codes.
Return values
F_NO_ERRORIf the seek operation was successful
!F_NO_ERRORIf there was an error

◆ f_settimedate

#define f_settimedate ( filename,
ctime,
cdate )   fm_settimedate(filename, ctime, cdate)

#include <api_f.h>

Set the time and date of a file or directory.

Parameters
filenameThe name of the file or directory to modify.
ctimeThe creation time of the file or directory.
cdateThe creation date of the file or directory.
Return values
F_NO_ERRORIf able to set time and date
!F_NO_ERRORIf unable to set time and date

◆ f_write

#define f_write ( buf,
size,
size_st,
filehandle )   fm_write(buf, size, size_st, filehandle)

#include <api_f.h>

Write data to the file at the current position.

Parameters
bufA pointer to the data to write.
sizeThe size of the items to write.
size_stThe number of items to write.
filehandleA handle to the file to write to.
Returns
The number of items written.

Function Documentation

◆ f_enterFS()

int f_enterFS ( void )
extern

#include <api_f.h>

Adds a new task priority to the task list used by the file system.

This function needs to be called when a new task wants to use the file system, before any other calls to other file system functions. Up to 10 tasks can be assigned to use the file system at any given time.

Note: The task priority level is associated with the task list, not the task itself. This means that a task switched priority levels and still wants to use the file system, it will need to be called again.

Return values
0If successful
!0If there were errors
See also
f_releaseFS()

◆ f_releaseFS()

void f_releaseFS ( void )
extern

#include <api_f.h>

Removes a task priority from the task list used by the file system.

When a task no longer needs to use the file system, or prior to task changing priorities, this should be called. In the case of a task changing priorities, if access to the file system is still desired, another call to f_enterFS() should be made.

See also
f_releaseFS()