UNIX compatible file system functions. More...
Data Structures | |
struct | dirent |
Directory entry structure. More... | |
struct | _dirdesc |
Internally used directory information structure. More... | |
struct | IOCTL_ARG2 |
General structure for two arguments. More... | |
struct | IOCTL_ARG3 |
General structure for three arguments. More... | |
struct | _FSCP_VOL_MOUNT |
struct | _FSCP_RENAME |
struct | _FSCP_STATUS |
struct | stat |
File status structure. More... | |
Modules | |
Reading Directories | |
UNIX compatible directory read functions. | |
Defines | |
#define | FS_VOL_MOUNT 0x1130 |
#define | FS_VOL_UNMOUNT 0x1131 |
#define | FS_RENAME 0x1132 |
#define | NUTFS_UNLINK 0x1133 |
#define | NUTFS_MKDIR 0x1134 |
#define | NUTFS_RMDIR 0x1135 |
#define | S_ISDIR(m) ((m) != 0) |
Check for directory. | |
#define | S_ISREG(m) ((m) == 0) |
Check for regular file. | |
Typedefs | |
typedef struct _dirdesc | DIR |
Internally used directory information structure. | |
typedef struct _FSCP_VOL_MOUNT | FSCP_VOL_MOUNT |
typedef struct _FSCP_RENAME | FSCP_RENAME |
typedef struct _FSCP_STATUS | FSCP_STATUS |
Functions | |
int | access (const char *path, int what) |
Check the accessibility of a file. | |
long | lseek (int fh, long pos, int whence) |
Reposition a file pointer. | |
int | rmdir (const char *path) |
Remove a directory. | |
int | unlink (const char *path) |
Remove a file entry. | |
int | stat (const char *path, struct stat *s) |
Get information about a specified file. | |
int | fstat (int fh, struct stat *s) |
Get information about an opened file. | |
int | mkdir (const char *path, int mode) |
Create a directory entry. | |
int | rename (const char *old_name, const char *new_name) |
Rename a file. | |
File System Directory Configuration | |
The Nut/OS Configurator may be used to override the default values. | |
#define | MAXNAMLEN 255 |
UDP port of DHCP server. | |
File System I/O Control Codes | |
#define | FS_STATUS 0x1101 |
Obtain information about a specified file entry. | |
#define | FS_DIR_CREATE 0x1111 |
Create a new directory entry. | |
#define | FS_DIR_REMOVE 0x1112 |
Remove a previously created directory entry. | |
#define | FS_DIR_OPEN 0x1113 |
Open a directory stream. | |
#define | FS_DIR_CLOSE 0x1114 |
Close a directory stream. | |
#define | FS_DIR_READ 0x1115 |
Read the next directory entry. | |
#define | FS_FILE_STATUS 0x1121 |
Obtain information about an opened file. | |
#define | FS_FILE_DELETE 0x1122 |
Remove a previously created file. | |
#define | FS_FILE_SEEK 0x1123 |
Set a file pointer position. |
UNIX compatible file system functions.
#define MAXNAMLEN 255 |
UDP port of DHCP server.
#define FS_STATUS 0x1101 |
Obtain information about a specified file entry.
Referenced by PnutIOCtl(), and stat().
#define FS_DIR_CREATE 0x1111 |
Create a new directory entry.
Referenced by mkdir(), and PnutIOCtl().
#define FS_DIR_REMOVE 0x1112 |
Remove a previously created directory entry.
Referenced by PnutIOCtl(), and rmdir().
#define FS_DIR_OPEN 0x1113 |
Open a directory stream.
Referenced by opendir(), and PnutIOCtl().
#define FS_DIR_CLOSE 0x1114 |
Close a directory stream.
Referenced by closedir(), and PnutIOCtl().
#define FS_DIR_READ 0x1115 |
Read the next directory entry.
Referenced by PnutIOCtl(), and readdir().
#define FS_FILE_STATUS 0x1121 |
Obtain information about an opened file.
Referenced by PnutIOCtl().
#define FS_FILE_DELETE 0x1122 |
Remove a previously created file.
Referenced by PnutIOCtl(), and unlink().
#define FS_FILE_SEEK 0x1123 |
Set a file pointer position.
Referenced by _seek(), _tell(), PnutIOCtl(), and UromIOCtl().
#define FS_VOL_MOUNT 0x1130 |
Referenced by MmCardMount(), NutBlockDeviceOpen(), and SpiMmcMount().
#define FS_VOL_UNMOUNT 0x1131 |
Referenced by MmCardUnmount(), NutBlockDeviceClose(), and SpiMmcUnmount().
#define FS_RENAME 0x1132 |
Referenced by rename().
#define NUTFS_UNLINK 0x1133 |
#define NUTFS_MKDIR 0x1134 |
#define NUTFS_RMDIR 0x1135 |
#define S_ISDIR | ( | m | ) | ((m) != 0) |
Check for directory.
Referenced by NutFtpProcessCwd(), and NutFtpTransferDirectoryOptions().
#define S_ISREG | ( | m | ) | ((m) == 0) |
Check for regular file.
Referenced by NutFtpTransferFile().
Internally used directory information structure.
Applications should ignore its contents.
typedef struct _FSCP_VOL_MOUNT FSCP_VOL_MOUNT |
typedef struct _FSCP_RENAME FSCP_RENAME |
typedef struct _FSCP_STATUS FSCP_STATUS |
int access | ( | const char * | path, |
int | what | ||
) |
Check the accessibility of a file.
path | Pathname of the file to check. |
what | Access permission to check. Set to F_OK for existence check or any of the following values or'ed:
|
References stat().
Referenced by SnmpMibFind().
long lseek | ( | int | fh, |
long | pos, | ||
int | whence | ||
) |
Reposition a file pointer.
fh | Handle of an open file. |
pos | Positioning value. |
whence | Positioning directive. |
int rmdir | ( | const char * | path | ) |
Remove a directory.
path | Pathname of the directory. Must be the full pathname including the device, because Nut/OS doesn't support relative paths. |
References FS_DIR_REMOVE.
Referenced by NutFtpProcessRmd().
int unlink | ( | const char * | path | ) |
Remove a file entry.
References FS_FILE_DELETE.
Referenced by NutFtpProcessDelete(), and NutFtpTransferFile().
Get information about a specified file.
References _NUTDEVICE::dev_ioctl, FS_STATUS, NutDeviceLookup(), _FSCP_STATUS::par_path, and _FSCP_STATUS::par_stp.
Referenced by access(), NutFtpProcessCwd(), NutFtpRenamePrepare(), NutFtpTransferDirectoryOptions(), and NutFtpTransferFile().
int fstat | ( | int | fh, |
struct stat * | s | ||
) |
Get information about an opened file.
Referenced by MediaTypeHandlerBinary().
int mkdir | ( | const char * | path, |
int | mode | ||
) |
Create a directory entry.
References FS_DIR_CREATE.
Referenced by NutFtpProcessMkd().
int rename | ( | const char * | old_name, |
const char * | new_name | ||
) |
Rename a file.
New and old filename must contain the name of a registered device, followed by a colon and a filename. Moving a file from one device to another is not supported.
old_name | Pathname of an existing file. |
new_name | New pathname. |
References _NUTDEVICE::dev_ioctl, ENOENT, errno, FS_RENAME, NutDeviceLookup(), _FSCP_RENAME::par_new, _FSCP_RENAME::par_old, rc, and strcmp().
Referenced by NutFtpRenameAction().