The Standard Embedded Flash File System, EFFS-STD
#include< fsf.h>
.
More...
|
| #define | fs_getfreespace(drivenum, space) |
| | Provides information about the drive space usage.
|
| #define | fs_mkdir(dirname) |
| | Makes a new directory.
|
| #define | fs_chdir(dirname) |
| | Change the directory.
|
| #define | fs_rmdir(dirname) |
| | Removes a directory.
|
| #define | fs_delete(filename) |
| | Deletes a file.
|
| #define | fs_findfirst(filename, find) |
| | Find the first file or subdirectory in a specified directory.
|
| #define | fs_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) |
| | Opens a file in the file system.
|
| #define | fs_close(filehandle) |
| | Closes an opened file.
|
| #define | fs_write(buf, size, size_st, filehandle) |
| | Write data to the file at the current position.
|
| #define | fs_read(buf, size, size_st, filehandle) |
| | Read data from the current position in a file.
|
| #define | fs_seek(filehandle, offset, whence) |
| | Move the stream position of an open file.
|
| #define | fs_eof(filehandle) |
| | Check whether the current position in the open target file is the end of the file.
|
| #define | fs_rewind(filehandle) |
| | Sets the file position in the open target file to the start of the file.
|
| #define | fs_settimedate(filename, ctime, cdate) |
| | Set the time and date of a file or directory.
|
| #define | fs_gettimedate(filename, pctime, pcdate) |
| | Get the time and date of a file or directory.
|
The Standard Embedded Flash File System, EFFS-STD
#include< fsf.h>
.
◆ fs_chdir
| #define fs_chdir |
( |
| dirname | ) |
|
#include <fsf.h>
Value:
Change the directory.
- Parameters
-
| dirname | The directory to change to. |
- Return values
-
| FS_NOERR | If able to change to the directory |
| !FS_NOERR | If unable to change to the directory |
- See also
- fs_mkdir()
-
fs_rmdir()
◆ fs_close
| #define fs_close |
( |
| filehandle | ) |
|
#include <fsf.h>
Value:
Closes an opened file.
- Parameters
-
| filehandle | A handle to the file to close. |
- Return values
-
| FS_NOERR | If able to close the file |
| !FS_NOERR | If unable to close the file |
◆ fs_delete
| #define fs_delete |
( |
| filename | ) |
|
#include <fsf.h>
Value:
Deletes a file.
A read-only or open file cannot be deleted.
- Parameters
-
| filename | The name of the file to be deleted. |
- Return values
-
| FS_NOERR | If able to delete the file |
| !FS_NOERR | If unable to delete the file |
◆ fs_eof
| #define fs_eof |
( |
| filehandle | ) |
|
#include <fsf.h>
Value:
Check whether the current position in the open target file is the end of the file.
- Parameters
-
| filehandle | A handle to the file to check. |
- Return values
-
| 0 | Nothing at the end of the file |
| !0 | The end of the file, or an error |
◆ fs_findfirst
| #define fs_findfirst |
( |
| filename, |
|
|
| find ) |
#include <fsf.h>
Value:fsm_findfirst(filename, find)
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
-
| filename | The name of the file to find. |
| find | Where to store the found information. |
- Return values
-
| FS_NOERR | If the file was found |
| !FS_NOERR | If the file wasn't found or there are errors |
- See also
- fs_findnext()
◆ fs_findnext
| #define fs_findnext |
( |
| find | ) |
|
#include <fsf.h>
Value:
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
-
| find | Where to store the found information. |
- Return values
-
| FS_NOERR | If the file was found |
| !FS_NOERR | If the file wasn't found or there are errors |
- See also
- fs_findfirst()
◆ fs_getfreespace
| #define fs_getfreespace |
( |
| drivenum, |
|
|
| space ) |
#include <fsf.h>
Value:fsm_getfreespace(drivenum, space)
Provides information about the drive space usage.
- Parameters
-
| drivenum | The drive number to get space usage for. |
| space | The structure to store the usage information in. |
- Return values
-
| FS_NOERR | If able to get the drive space usage |
| !FS_NOERR | If unable to get the drive space usage |
◆ fs_gettimedate
| #define fs_gettimedate |
( |
| filename, |
|
|
| pctime, |
|
|
| pcdate ) |
#include <fsf.h>
Value:fsm_gettimedate(filename, pctime, pcdate)
Get the time and date of a file or directory.
- Parameters
-
| filename | The name of the file or directory to modify. |
| pctime | A pointer to store the creation time of the file or directory. |
| pcdate | A pointer to store the creation date of the file or directory. |
- Return values
-
| FS_NOERR | If able to get time and date |
| !FS_NOERR | If unable to get time and date |
◆ fs_mkdir
| #define fs_mkdir |
( |
| dirname | ) |
|
#include <fsf.h>
Value:
Makes a new directory.
- Parameters
-
| dirname | The name to use for the new directory. |
- Return values
-
| FS_NOERR | If able to make the directory |
| !FS_NOERR | If unable to make the directory |
- See also
- fs_chdir()
-
fs_rmdir()
◆ fs_open
| #define fs_open |
( |
| filename, |
|
|
| mode ) |
#include <fsf.h>
Value:
Opens a file in the file system.
- Parameters
-
| filename | The name of the file to open. |
| mode | The 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 |
| 0 | If it a file could not be opened |
- See also
- fs_close()
◆ fs_read
| #define fs_read |
( |
| buf, |
|
|
| size, |
|
|
| size_st, |
|
|
| filehandle ) |
#include <fsf.h>
Value:fsm_read(buf, size, size_st, filehandle)
Read data from the current position in a file.
- Parameters
-
| buf | A pointer where the data should be read. |
| size | The size of the items to be read. |
| size_st | The number of items to be read. |
| filehandle | A handle to the file to read to. |
- Returns
- The number of items read.
◆ fs_rewind
| #define fs_rewind |
( |
| filehandle | ) |
|
#include <fsf.h>
Value:
Sets the file position in the open target file to the start of the file.
- Parameters
-
| filehandle | A handle to the file operate on. |
- Return values
-
| FS_NOERR | If successful |
| !FS_NOERR | If there was an error |
◆ fs_rmdir
| #define fs_rmdir |
( |
| dirname | ) |
|
#include <fsf.h>
Value:
Removes a directory.
Note: The target directory must be empty, otherwise an error code is returned.
- Parameters
-
| dirname | The name of the directory to remove. |
- Return values
-
| FS_NOERR | If able to get the drive space usage |
| !FS_NOERR | If unable to get the drive space usage |
- See also
- fs_chdir()
-
fs_mkdir()
◆ fs_seek
| #define fs_seek |
( |
| filehandle, |
|
|
| offset, |
|
|
| whence ) |
#include <fsf.h>
Value:fsm_seek(filehandle, offset, whence)
Move the stream position of an open file.
- Parameters
-
| filehandle | A handle to the file to move the position of. |
| offset | The relative byte position according to whence. |
| whence | Where to calculate the offset from. Can be a value from fSeekCodeGroup. |
- Return values
-
| FS_NOERR | If the seek operation was successful |
| !FS_NOERR | If there was an error |
◆ fs_settimedate
| #define fs_settimedate |
( |
| filename, |
|
|
| ctime, |
|
|
| cdate ) |
#include <fsf.h>
Value:fsm_settimedate(filename, ctime, cdate)
Set the time and date of a file or directory.
- Parameters
-
| filename | The name of the file or directory to modify. |
| ctime | The creation time of the file or directory. |
| cdate | The creation date of the file or directory. |
- Return values
-
| FS_NOERR | If able to set time and date |
| !FS_NOERR | If unable to set time and date |
◆ fs_write
| #define fs_write |
( |
| buf, |
|
|
| size, |
|
|
| size_st, |
|
|
| filehandle ) |
#include <fsf.h>
Value:fsm_write(buf, size, size_st, filehandle)
Write data to the file at the current position.
- Parameters
-
| buf | A pointer to the data to write. |
| size | The size of the items to write. |
| size_st | The number of items to write. |
| filehandle | A handle to the file to write to. |
- Returns
- The number of items written.