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. | |
#include< api_f.h >
The FAT32 Embedded Flash File System for Flash Cards, EFFS-FAT
#define f_chdir | ( | dirname | ) | fm_chdir(dirname) |
#define f_close | ( | filehandle | ) | fm_close(filehandle) |
#include <api_f.h>
Closes an opened file.
filehandle | A handle to the file to close. |
F_NO_ERROR | If able to close the file |
!F_NO_ERROR | If unable to close the file |
#define f_delete | ( | filename | ) | fm_delete(filename) |
#include <api_f.h>
Deletes a file.
A read-only or open file cannot be deleted.
filename | The name of the file to be deleted. |
F_NO_ERROR | If able to delete the file |
!F_NO_ERROR | If unable to delete the file |
#define f_delvolume | ( | drvnumber | ) | fm_delvolume(drvnumber) |
#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.
filehandle | A handle to the file to check. |
0 | Nothing at the end of the file |
!0 | The end of the file, or an error |
#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.
filename | The name of the file to find. |
find | Where to store the found information. |
F_NO_ERROR | If the file was found |
!F_NO_ERROR | If the file wasn't found or there are errors |
#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.
find | Where to store the found information. |
F_NO_ERROR | If the file was found |
!F_NO_ERROR | If the file wasn't found or there are errors |
#define f_getfreespace | ( | drivenum, | |
pspace ) fm_getfreespace(drivenum, pspace) |
#include <api_f.h>
Provides information about the drive space usage.
drivenum | The drive number to get space usage for. |
pspace | The structure to store the usage information in. |
F_NO_ERROR | If able to get the drive space usage |
!F_NO_ERROR | If unable to get the drive space usage |
#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.
filename | The name of the file or directory to modify. | |
[out] | pctime | A pointer to store the creation time of the file or directory. |
[out] | pcdate | A pointer to store the creation date of the file or directory. |
F_NO_ERROR | If able to get time and date |
!F_NO_ERROR | If unable to get time and date |
#define f_mkdir | ( | dirname | ) | fm_mkdir(dirname) |
#define f_open | ( | filename, | |
mode ) fm_open(filename, mode) |
#include <api_f.h>
Opens a file in the file system.
filename | The name of the file to open. |
mode | The mode to open the file in. The following options are available:
|
F_FILE* | Pointer to the file if it could be opened |
0 | If it a file could not be opened |
#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.
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. |
#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.
filehandle | A handle to the file operate on. |
F_NO_ERROR | If successful |
!F_NO_ERROR | If there was an error |
#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.
dirname | The name of the directory to remove. |
F_NO_ERROR | If able to remove the directory |
!F_NO_ERROR | If unable to remove the directory |
#define f_seek | ( | filehandle, | |
offset, | |||
whence ) fm_seek(filehandle, offset, whence) |
#include <api_f.h>
Move the stream position of an open file.
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 FAT File System Seek Codes. |
F_NO_ERROR | If the seek operation was successful |
!F_NO_ERROR | If there was an error |
#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.
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. |
F_NO_ERROR | If able to set time and date |
!F_NO_ERROR | If unable to set time and date |
#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.
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. |
|
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.
0 | If successful |
!0 | If there were errors |
|
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.