Data Structures | |
struct | _PHATFIND |
Defines | |
#define | PHAT_MAX_NAMELEN 255 |
Maximum length of a base file name. | |
#define | PHAT_MAXDIRENT 65536 |
Maximum number of directory entries. | |
#define | PHAT_REM_DIRENT 0xE5 |
#define | PHAT_REM_NAMENT 0x05 |
Typedefs | |
typedef _PHATFIND | PHATFIND |
Functions | |
struct | __attribute__ ((packed)) _PHATDIRENT |
Operating system configuration type. | |
int | PhatDirCreate (NUTDEVICE *dev, char *path) |
Create a new subdirectory. | |
int | PhatDirDelEntry (NUTDEVICE *dev, CONST char *path, u_long flags) |
Remove a directory entry. | |
int | PhatDirEntryCreate (NUTFILE *ndp, CONST char *name, int acc, PHATDIRENT *dirent) |
Create a new directory entry. | |
int | PhatDirEntryFind (NUTFILE *ndp, CONST char *spec, u_long attmsk, PHATFIND *srch) |
Find a directory entry with a specified name. | |
int | PhatDirEntryStatus (NUTDEVICE *dev, CONST char *path, struct stat *stp) |
Retrieve status of a specified file. | |
int | PhatDirEntryUpdate (NUTFILE *nfp) |
Update directory entry of an opened file or directory. | |
NUTFILE * | PhatDirOpen (NUTDEVICE *dev, CONST char *dpath) |
Open a directory. | |
NUTFILE * | PhatDirOpenParent (NUTDEVICE *dev, CONST char *path, CONST char **basename) |
Open parent directory of a given path. | |
int | PhatDirRead (DIR *dir) |
Read the next directory entry. | |
int | PhatDirReleaseChain (NUTDEVICE *dev, PHATDIRENT *dent) |
Release a cluster chain of a specified directory entry. | |
int | PhatDirRemove (NUTDEVICE *dev, char *path) |
Remove a specified subdirectory. | |
int | PhatDirRenameEntry (NUTDEVICE *dev, CONST char *old_path, CONST char *new_path) |
Rename file. | |
Variables | |
PHATDIRENT | |
PHATXDIRENT |
struct __attribute__ | ( | (packed) | ) |
Operating system configuration type.
Once created, this structure will never change if it points to another directory. Except if the entry is removed.
File name, padded with blanks.
File attributes.
See PHAT_FATTR_ flags.
Reserved byte, possibly used by NT.
Hundredth of seconds of file creation time.
File creation time.
File creation date.
Last file access date.
High bytes of first cluster of this file.
If used with the double dot entry, dent_clusthi and dent_clust must be zero if the entry points to the root directory.
The same is true when pointing to a normal file with zero length.
Last file modification time.
Last file modification date.
First cluster used.
This is zero for empty files.
Size of the file in bytes.
For directories, this is always zero.
int PhatDirCreate | ( | NUTDEVICE * | dev, | |
char * | path | |||
) |
Create a new subdirectory.
One cluster is allocated, initialized to zero and two directory entries are created, '.' and '..'.
dev | Specifies the file system device. | |
path | Full path to the directory. |
Remove a directory entry.
Allocated clusters are released.
dev | Specifies the file system device. | |
path | Name of the entry to remove. | |
flags | Attributes of the entry to remove. |
int PhatDirEntryCreate | ( | NUTFILE * | ndp, | |
CONST char * | name, | |||
int | acc, | |||
PHATDIRENT * | dirent | |||
) |
Create a new directory entry.
ndp | Handle to the parent directory. | |
name | Name of the new entry. | |
acc | Attributes of the new entry. | |
dirent | Information structure of the new entry. |
Find a directory entry with a specified name.
ndp | Pointer to a previously opened directory. | |
spec | Name of the entry to retrieve. | |
attmsk | Attribute mask. Entries with attributes not specified in this mask will be ignored. | |
srch | Optional pointer to a structure which receives the search result. |
Retrieve status of a specified file.
dev | File system device. | |
path | Path name to the file to query. | |
stp | Pointer to a structure which receives the result. |
int PhatDirEntryUpdate | ( | NUTFILE * | nfp | ) |
Update directory entry of an opened file or directory.
nfp | File of which the directory entry will be updated. |
Open a directory.
dev | Specifies the file system device. | |
dpath | Full absolute pathname of the directory to open. |
Open parent directory of a given path.
dev | Specifies the file system device. | |
path | Full path. | |
basename | Points to a pointer which will be set to the last component within the full path. |
int PhatDirRead | ( | DIR * | dir | ) |
Read the next directory entry.
dir | Pointer to the internal directory information structure. |
int PhatDirReleaseChain | ( | NUTDEVICE * | dev, | |
PHATDIRENT * | dent | |||
) |
Release a cluster chain of a specified directory entry.
dev | Specifies the file system device. | |
dent | Directory entry. |
int PhatDirRemove | ( | NUTDEVICE * | dev, | |
char * | path | |||
) |
Remove a specified subdirectory.
dev | Specifies the file system device. | |
path | Full path to the directory. |
int PhatDirRenameEntry | ( | NUTDEVICE * | dev, | |
CONST char * | old_path, | |||
CONST char * | new_path | |||
) |
Rename file.
dev | Specifies the file system device. | |
old_path | Old name and path of the file. | |
new_path | New name and path of the file. |