Embedded TCP/IP stack
4.1.0
|
ROM File System API
Detailed Description
The FNET ROM File System provides read-only access to files and directories.
The FNET project has the special GUI PC tool that is used to create the ROM file-system image files.
After the FS is initialized by calling the fnet_fs_init() function, a user application should call the fnet_fs_rom_register() function and finally mount a ROM FS Image by passing the FNET_FS_ROM_NAME and the fnet_fs_rom_image structure as arguments to the fnet_fs_mount() function.
Thereafter an application has access to files and directories on the mounted FNET ROM FS image.
For example:
...
// FNET FS initialization.
if( fnet_fs_init( ) == FNET_OK)
{
// Register FNET ROM FS.
// Mount FNET ROM FS image.
fnet_println("ERROR: FS image mount is failed!");
...
// Print directory content.
{
struct fnet_fs_dirent ep;
fnet_fs_dir_t dir;
fnet_uint8_t name[FNET_CFG_FS_MOUNT_NAME_MAX+1];
// Open dir.
dir = fnet_fs_opendir("rom");
if (dir)
{
ep.d_name = name;
ep.d_name_size = sizeof(name);
// Print the dir content.
// Close dir.
fnet_fs_closedir(dir);
}
else
fnet_println("ERROR: The directory is failed!");
}
...
}
else
{
fnet_println("ERROR: FNET FS initialization is failed!");
}
...
Configuration parameters:
Data Structures | |
struct | fnet_fs_rom_node |
FNET ROM file-system node. The node represents a file or a directory. More... | |
struct | fnet_fs_rom_image |
FNET ROM file-system image. More... | |
Macros | |
#define | FNET_FS_ROM_NAME |
FNET ROM file-system name string. More... | |
#define | FNET_FS_ROM_VERSION |
FNET ROM file-system current version. More... | |
Functions | |
void | fnet_fs_rom_register (void) |
Registers the FNET ROM file system. More... | |
void | fnet_fs_rom_unregister (void) |
Unregisters the FNET ROM file system. More... | |
© 2005-2018 by Andrey Butok. http://fnet.sourceforge.net