NetBurner 3.5.0
PDF Version
 
EFFS-STD Flash File System

Topics

 STD File System Seek Codes
 

Macros

#define fs_getfreespace(drivenum, space)   fsm_getfreespace(drivenum, space)
 Provides information about the drive space usage.
 
#define fs_mkdir(dirname)   fsm_mkdir(dirname)
 Makes a new directory.
 
#define fs_chdir(dirname)   fsm_chdir(dirname)
 Change the directory.
 
#define fs_rmdir(dirname)   fsm_rmdir(dirname)
 Removes a directory.
 
#define fs_delete(filename)   fsm_delete(filename)
 Deletes a file.
 
#define fs_findfirst(filename, find)   fsm_findfirst(filename, find)
 Find the first file or subdirectory in a specified directory.
 
#define fs_findnext(find)   fsm_findnext(find)
 Finds the next file or subdirectory in a specified directory after a previous call to fs_findfirst() or fs_findnext().
 
#define fs_open(filename, mode)   fsm_open(filename, mode)
 Opens a file in the file system.
 
#define fs_close(filehandle)   fsm_close(filehandle)
 Closes an opened file.
 
#define fs_write(buf, size, size_st, filehandle)   fsm_write(buf, size, size_st, filehandle)
 Write data to the file at the current position.
 
#define fs_read(buf, size, size_st, filehandle)   fsm_read(buf, size, size_st, filehandle)
 Read data from the current position in a file.
 
#define fs_seek(filehandle, offset, whence)   fsm_seek(filehandle, offset, whence)
 Move the stream position of an open file.
 
#define fs_eof(filehandle)   fsm_eof(filehandle)
 Check whether the current position in the open target file is the end of the file.
 
#define fs_rewind(filehandle)   fsm_rewind(filehandle)
 Sets the file position in the open target file to the start of the file.
 
#define fs_settimedate(filename, ctime, cdate)   fsm_settimedate(filename, ctime, cdate)
 Set the time and date of a file or directory.
 
#define fs_gettimedate(filename, pctime, pcdate)   fsm_gettimedate(filename, pctime, pcdate)
 Get the time and date of a file or directory.
 

Detailed Description

#include< fsf.h >

The Standard Embedded Flash File System, EFFS-STD

Macro Definition Documentation

◆ fs_chdir

#define fs_chdir ( dirname)    fsm_chdir(dirname)

#include <fsf.h>

Change the directory.

Parameters
dirnameThe directory to change to.
Return values
FS_NOERRIf able to change to the directory
!FS_NOERRIf unable to change to the directory
See also
fs_mkdir()
fs_rmdir()

◆ fs_close

#define fs_close ( filehandle)    fsm_close(filehandle)

#include <fsf.h>

Closes an opened file.

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

◆ fs_delete

#define fs_delete ( filename)    fsm_delete(filename)

#include <fsf.h>

Deletes a file.

A read-only or open file cannot be deleted.

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

◆ fs_eof

#define fs_eof ( filehandle)    fsm_eof(filehandle)

#include <fsf.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

◆ fs_findfirst

#define fs_findfirst ( filename,
find )   fsm_findfirst(filename, find)

#include <fsf.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
FS_NOERRIf the file was found
!FS_NOERRIf the file wasn't found or there are errors
See also
fs_findnext()

◆ fs_findnext

#define fs_findnext ( find)    fsm_findnext(find)

#include <fsf.h>

Finds the next file or subdirectory in a specified directory after a previous call to fs_findfirst() or fs_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
FS_NOERRIf the file was found
!FS_NOERRIf the file wasn't found or there are errors
See also
fs_findfirst()

◆ fs_getfreespace

#define fs_getfreespace ( drivenum,
space )   fsm_getfreespace(drivenum, space)

#include <fsf.h>

Provides information about the drive space usage.

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

◆ fs_gettimedate

#define fs_gettimedate ( filename,
pctime,
pcdate )   fsm_gettimedate(filename, pctime, pcdate)

#include <fsf.h>

Get the time and date of a file or directory.

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

◆ fs_mkdir

#define fs_mkdir ( dirname)    fsm_mkdir(dirname)

#include <fsf.h>

Makes a new directory.

Parameters
dirnameThe name to use for the new directory.
Return values
FS_NOERRIf able to make the directory
!FS_NOERRIf unable to make the directory
See also
fs_chdir()
fs_rmdir()

◆ fs_open

#define fs_open ( filename,
mode )   fsm_open(filename, mode)

#include <fsf.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
FS_FILE*Pointer to the file if it could be opened
0If it a file could not be opened
See also
fs_close()

◆ fs_read

#define fs_read ( buf,
size,
size_st,
filehandle )   fsm_read(buf, size, size_st, filehandle)

#include <fsf.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.

◆ fs_rewind

#define fs_rewind ( filehandle)    fsm_rewind(filehandle)

#include <fsf.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
FS_NOERRIf successful
!FS_NOERRIf there was an error

◆ fs_rmdir

#define fs_rmdir ( dirname)    fsm_rmdir(dirname)

#include <fsf.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
FS_NOERRIf able to get the drive space usage
!FS_NOERRIf unable to get the drive space usage
See also
fs_chdir()
fs_mkdir()

◆ fs_seek

#define fs_seek ( filehandle,
offset,
whence )   fsm_seek(filehandle, offset, whence)

#include <fsf.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 fSeekCodeGroup.
Return values
FS_NOERRIf the seek operation was successful
!FS_NOERRIf there was an error

◆ fs_settimedate

#define fs_settimedate ( filename,
ctime,
cdate )   fsm_settimedate(filename, ctime, cdate)

#include <fsf.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
FS_NOERRIf able to set time and date
!FS_NOERRIf unable to set time and date

◆ fs_write

#define fs_write ( buf,
size,
size_st,
filehandle )   fsm_write(buf, size, size_st, filehandle)

#include <fsf.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.