Description
This page describes the FSManager interface which provides access to file systems, making file access independent from file systems and allowing many file systems to be used transparently. So, a module doesn't need to know if it's using a FAT or Ext2 file system. But, if it needs so it can use a specific file system function.
To achieve this flexibility, each file system must be mounted, that is, linked to the file systems manager and to a device.
A module to be mounted must implement FileSystem interface and can only be mounted into a module that implements BlockDev interface.
The same file system from the same unit and device can be mounted on various differents directories, but only one file system can be mounted on a directory.
Mount a file system means to make it available to the system. So, it doesn't make sense to mount a file system in an inexistent directory, because it going to be unavailable. In the same manner, it doesn't make sense to remove the directory where the file system is mounted.
With this definition it's clear that the directory where a file system is going to be mounted must exist and must be blocked (can't be removed, moved, etc).
A file or directory handler provided by a system function is unique in all system. But a file or directory handler provided by user functions is unique only in the task.
Current interface only supports files with maximum size of 2 GB.
Structures
typedef struct {
unsigned short size;
char name[1];
} FSManager_DirEntry;
Where size is the size of this entire DirEntry. name is a null-terminated file name.
typedef struct {
unsigned int mode;
unsigned int nlink;
unsigned int uid;
unsigned int gid;
int size;
unsigned int blksize;
unsigned int blocks;
unsigned int atime;
unsigned int mtime;
unsigned int ctime;
} FSManager_EntryStatus;
nlink is the number of hard links.
uid is the user ID of owner.
gid is the group ID of owner.
size is the size of the file (if it is a regular file or a symlink) in bytes. The size of a symlink is the length of the pathname it contains, without trailing NULL.
blksize is the "preferred" blocksize for efficient file system I/O. (Writing to a file in smaller chunks may cause an inefficient read-modify-rewrite.)
blocks is the size of the file in 512-byte blocks.
Not all filesystems implement all of the time fields.
atime is the time of last access. For instance: Read.
mtime is the time of last modification. For instance: Write. mtime of a directory is changed by the creation or deletion of files in that directory. mtime is not changed for changes in owner, group, hard link count, or mode.
ctime is the time of last change. For instance: Write. ctime is changed by setting inode information (i.e., owner, group, link count, mode, etc.).
mode can be (in octal):
0170000 - FSManager_TYPE_MASK - bitmask for the file type bitfields
0140000 - FSManager_TYPE_SOCKET - socket
0120000 - FSManager_TYPE_LINK - symbolic link
0100000 - FSManager_TYPE_FILE - regular file
0060000 - FSManager_TYPE_BLOCK_DEV - block device
0040000 - FSManager_TYPE_DIR - directory
0020000 - FSManager_TYPE_CHAR_DEV - character device
0010000 - FSManager_TYPE_FIFO - fifo
0004000 - FSManager_UID_BIT - set UID bit
0002000 - FSManager_GID_BIT - set GID bit
0001000 - FSManager_STICKY_BIT - sticky bit
0000700 - FSManager_USER_RWX - mask for file owner permissions
0000400 - FSManager_USER_READ - owner has read permission
0000200 - FSManager_USER_WRITE - owner has write permission
0000100 - FSManager_USER_EXEC - owner has execute permission
0000070 - FSManager_GROUP_RWX - mask for group permissions
0000040 - FSManager_GROUP_READ - group has read permission
0000020 - FSManager_GROUP_WRITE - group has write permission
0000010 - FSManager_GROUP_EXEC - group has execute permission
0000007 - FSManager_OTHER_RWX - mask for permissions for others
0000004 - FSManager_OTHER_READ - others have read permission
0000002 - FSManager_OTHER_WRITE - others have write permisson
0000001 - FSManager_OTHER_EXEC - others have execute permission
typedef struct {
FSManager_Handle *fd;
int flags;
void *buf;
int size;
} FSManager_FDIO;
Where fd is the file descriptor, buf is the buffer where data will be written to if it is a read request or from where data will be read if it is a write request, size is the number of bytes to be read or written and flags must be 0 or the sum of:
- 0x01 - FSManager_USER_BUF_IO - buf is a buffer in user memory space
If all goes ok size will have the number of bytes read or written.
typedef struct {
FileSystem_Handle *fd;
} FSManager_Handle;
It is used only by modules that implement FileSystem interface.
typedef struct {
const char *str;
unsigned int len;
unsigned int hash;
} FSManager_ExStr;
It is used only by modules that implement FileSystem interface.
typedef struct FSManager__Dentry {
unsigned int count;
unsigned int mode;
unsigned int flags;
struct FSManager__Dentry *parent;
FSManager_FS *fs;
struct FSManager__Dentry *hashNext;
struct FSManager__Dentry *hashPrior;
struct FSManager__Dentry *lruNext;
struct FSManager__Dentry *lruPrior;
struct FSManager__Dentry *mounted;
unsigned int version;
TaskManager_Semaphore lock;
FSManager_ExStr name;
void *fsData;
char iname[FSManager_INAME_LEN];
} FSManager_Dentry;
It is used only by modules that implement FileSystem interface.
Configuration
This interface defines the following groups and keys available using the CfgManager interface:
/system/FSManager/root |
|
|
The following keys are defined in this group:
- fsImp - name of the implementation of the FileSystem interface to be used to mount the root directory (the file system to be mounted)
- devImp - name of the implementation of the BlockDev interface to be used to mount the root directory (the device to be mounted)
- unit - unit number of devImp to be used
- data - data to be passed to the file system
Some examples:
- fsImp = Ext2FS
- devImp = FDC
- unit = 0x0
- data =
|
System Functions
These functions are exclusive for system modules.
0x00 - Close
Syntax
int FSManager_Close(FSManager_Handle *fd);
Properties
Description
This function closes fd.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid fd
0x02 - Mount
Syntax
int FSManager_Mount(const char *fsImp, const char *devImp, unsigned int unit, const char *path, int prop, const char *data);
Properties
Description
This function mounts file system fsImp with properties prop. fsImp will use unit from device devImp.
fsImp must implement FileSystem interface. And devImp BlockDev interface.
data are specific data for the file system.
If path isn't a complete path, that is, one that starts with "/" and if the calling task has a current dir, it will be used. Otherwise, the root dir will be used.
prop can be:
- 0x01 - FSManager_MOUNT_RO - Mount read only
- 0x0100 - FSManager_MOUNT_PERMANENT - Mount permanently
It is not permited to mount a file system on a directory that has already a mounted file system.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_IN_USE - path or device is in use
- E_MODULE - Error getting fsImp or devImp module's functions
- E_CORRUPTED_FS - Corrupted file system
- E_BAD_TYPE - File system in devImp invalid
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - path is too big
- E_NOT_FOUND - path doesn't exist
- E_NOT_A_DIRECTORY - A component of path is not a directory
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing path
- E_FILE_ERROR - Undefined error
0x03 - Open
Syntax
int FSManager_Open(const char *pathname, int prop, FSManager_Handle **fd);
Properties
Description
This function opens file pathname with properties prop.
prop can be:
- 0x01 - FSManager_READ - Open for read
- 0x02 - FSManager_WRITE - Open for write
- 0x04 - FSManager_CREATE - Create file if it doesn't exist
- 0x08 - FSManager_EXCLUSIVE - Used with FSManager_CREATE to return an error if file exists
- 0x10 - FSManager_TRUNCATE - If file already exists it will be truncated
- 0x20 - FSManager_APPEND - Open in append mode
- 0x40 - FSManager_NOFOLLOW - If pathname is a symbolic link, then the open fails. Symbolic links in earlier components of the pathname will still be followed
- 0x80 - FSManager_DIRECTORY - If pathname is not a directory, then the open fails
FSManager_READ or FSManager_WRITE must be set, others can be added. (FSManager_WRITE + FSManager_CREATE, for instance).
In case prop has FSManager_CREATE, prop can have the follow values too (in octal):
- 070000000 - FSManager_O_USER_RWX - file owner has read, write and execute permission
- 040000000 - FSManager_O_USER_READ - file owner has read permission
- 020000000 - FSManager_O_USER_WRITE - file owner has write permission
- 010000000 - FSManager_O_USER_EXEC - file owner has execute permission
- 007000000 - FSManager_O_GROUP_RWX - group has read, write and execute permission
- 004000000 - FSManager_O_GROUP_READ - group has read permission
- 002000000 - FSManager_O_GROUP_WRITE - group has write permission
- 001000000 - FSManager_O_GROUP_EXEC - group has execute permission
- 000700000 - FSManager_O_OTHERS_RWX - others have read, write and execute permission
- 000400000 - FSManager_O_OTHERS_READ - others have read permission
- 000200000 - FSManager_O_OTHERS_WRITE - others have write permission
- 000100000 - FSManager_O_OTHERS_EXEC - others have execute permission
If pathname isn't a complete path, that is, starts with "/" and if the calling task has a current dir, it will be used. Otherwise the root dir will be used.
The file offset is set to the beginning of the file.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_NOT_FOUND - pathname doesn't exist
- E_TOO_MANY_OPEN_FILES - Too many open files
- E_NOT_FILE_DIR - pathname is not a file/directory (it is a socket, block device etc)
- E_NOT_A_DIRECTORY - pathname is not a directory and FSManager_DIRECTORY was set
- E_READ_ONLY_FS - Read only file system
- E_NO_MEMORY - Not enough memory available
- E_FILE_EXISTS - pathname already exists and FSManager_CREATE and FSManager_EXCLUSIVE were set
- E_TOO_BIG - pathname is too big
- E_NOT_A_DIRECTORY - A component of pathname is not a directory
- E_PERMISSION_DENIED - Permission denied
- E_FS_FULL - File system is full
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing pathname
- E_FILE_ERROR - Undefined error
0x05 - Read
Syntax
int FSManager_Read(FSManager_FDIO *request);
Properties
Description
This function processes read request.
In case of directory read, buf will have dir entries (FSManager_DirEntry).
If all goes ok, file position is advanced by the number of bytes read.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid request or file not opened for reading
- E_END_REACHED - End of file reached
- E_FAULT - buf points outside task's accessible address space
- E_IO_ERROR - I/O error
- E_FILE_ERROR - Undefined error
0x07 - Remove
Syntax
int FSManager_Remove(const char *pathname);
Properties
Description
This function removes pathname.
If pathname isn't a complete path, that is, starts with "/" and if the calling task has a current dir, it will be used. Otherwise the root dir will be used.
The file/directory pathname can be been used. Who is using it can continue to use, but won't be possible to open, list, etc.
A directory with files can't be removed.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_READ_ONLY_FS - Read only file system
- E_NOT_FOUND - pathname doesn't exist
- E_NOT_A_DIRECTORY - A component of pathname is not a directory
- E_TOO_BIG - pathname is too big
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_NO_MEMORY - Not enough memory available
- E_LOOP - Too many symbolic links encountered while traversing pathname
- E_FILE_ERROR - Undefined error
- E_NOT_EMPTY - Directory is not empty
- E_BUSY - pathname is the root directory of some task
0x09 - RewindDir
Syntax
int FSManager_RewindDir(FSManager_Handle *fd);
Properties
Description
This function repositions fd read offset to the beginning.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid fd
- E_NOT_A_DIRECTORY - fd is not a directory
0x0a - Seek
Syntax
int FSManager_Seek(FSManager_Handle *fd, int count, int prop, int *newPos);
Properties
Description
This functions repositions fd read/write offset to count bytes according to prop.
prop can be:
- 0x01 - FSManager_SEEK_START - relative to the beginning of file
- 0x02 - FSManager_SEEK_CURRENT - relative to current position
- 0x04 - FSManager_SEEK_END - relative to the end of file
If all goes ok, newPos, if different than NULL, will contain the new position.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid fd or prop
- E_TOO_BIG - Final position is bigger than maximum allowed
- E_NOT_ALLOWED - Operation not allowed
- E_IS_A_DIRECTORY - fd is a directory
- E_FILE_ERROR - Undefined error
0x0b - Status
Syntax
int FSManager_Status(const char *pathname, FSManager_EntryStatus *buf, int prop);
Properties
Description
This function gets informations about pathname and puts them in buf.
If pathname isn't a complete path, that is, one that starts with "/" and if the calling task has a current dir, it will be used. Otherwise the root dir will be used.
prop can be:
- 0x01 - FSManager_STATUS_LINK - get symbolic link information, if pathname is a symbolic link
- 0x80 - FSManager_USER_BUF - buf is a buffer in user memory space
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_NOT_FOUND - pathname doesn't exist
- E_NOT_A_DIRECTORY - A component of pathname is not a directory
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - pathname is too big
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing pathname
- E_FILE_ERROR - Undefined error
0x01 - StatusFD
Syntax
int FSManager_StatusFD(FSManager_Handle *fd, FSManager_EntryStatus *buf, int prop);
Properties
Description
This function gets informations about fd, which must have been opened by Open, and puts them in buf.
prop can be:
- 0x80 - FSManager_USER_BUF - buf is a buffer in user memory space
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_NO_MEMORY - Not enough memory available
- E_FILE_ERROR - Undefined error
0x0c - Unmount
Syntax
int FSManager_Unmount(const char *path, int prop);
Properties
Description
This function unmounts the file system mounted in path.
If pathname isn't a complete path, that is, one that starts with "/" and if the calling task has a current dir, it will be used. Otherwise the root dir will be used.
prop can be zero or the sum of:
- 0x01 - FSManager_FORCE_UNMOUNT - force file system unmount
- 0x0100 - FSManager_UNMOUNT_PERMANENT - don't mount it permanently anymore
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_IN_USE - File system in use
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - path is too big
- E_NOT_FOUND - path doesn't exist
- E_NOT_A_DIRECTORY - A component of path is not a directory
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing path
- E_FILE_ERROR - Undefined error
0x0d - Write
Syntax
int FSManager_Write(FSManager_FDIO *request);
Properties
Description
This function processes write request.
If all goes ok, file position is advanced by the number bytes written.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid request or file not opened for writing
- E_FS_FULL - File system is full
- E_READ_ONLY_FS - Read only file system
- E_IO_ERROR - I/O error
- E_IS_A_DIRECTORY - fd is a directory
- E_FILE_ERROR - Undefined error
User Functions
These functions are exclusive for user modules.
0x0e - UClose
Syntax
int FSManager_UClose(int fd);
Properties
User modules
Description
This function closes fd.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid fd
0x0f - UChangeDir
Syntax
int FSManager_UChangeDir(const char *path);
Properties
User modules
Description
This function changes task's current directory to path.
Current directory is used when a path doesn't start with "/".
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - path is too big
- E_NOT_FOUND - path doesn't exist
- E_NOT_A_DIRECTORY - A component of path is not a directory
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing path
- E_FILE_ERROR - Undefined error
- E_FAULT - path points outside task's accessible address space
0x10 - UChangeRoot
Syntax
int FSManager_UChangeRoot(const char *path);
Properties
User modules
Description
This function changes task's root directory to path.
Root directory is used when a path starts with "/".
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - path is too big
- E_NOT_FOUND - path doesn't exist
- E_NOT_A_DIRECTORY - A component of path is not a directory
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing path
- E_FILE_ERROR - Undefined error
- E_FAULT - path points outside task's accessible address space
0x11 - UMount
Syntax
int FSManager_UMount(const char *fsImp, const char *devImp, unsigned int unit, const char *path, int prop, const char *data);
Properties
User modules
Description
This function mounts file system fsImp with properties prop. fsImp will use unit from device devImp.
fsImp must implement FileSystem interface. And devImp BlockDev interface.
data are specific data for the file system.
prop can be:
- 0x01 - FSManager_MOUNT_RO - Mount read only
- 0x0100 - FSManager_MOUNT_PERMANENT - Mount permanently
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_IN_USE - path is in use
- E_MODULE - Error getting fsImp or devImp module's functions
- E_CORRUPTED_FS - Corrupted file system
- E_BAD_TYPE - File system in devImp invalid
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - path is too big
- E_NOT_FOUND - path doesn't exist
- E_NOT_A_DIRECTORY - A component of path is not a directory
- E_FAULT - fsImp or devImp or path or data points outside task's accessible address space
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing path
- E_FILE_ERROR - Undefined error
0x12 - UOpen
Syntax
int FSManager_UOpen(const char *pathname, int prop);
Properties
User modules
Description
This function opens pathname with properties prop.
prop can be:
- 0x01 - FSManager_READ - Open for read
- 0x02 - FSManager_WRITE - Open for write
- 0x04 - FSManager_CREATE - Create file if it doesn't exist
- 0x08 - FSManager_EXCLUSIVE - Used with FSManager_CREATE to return an error if file exists
- 0x10 - FSManager_TRUNCATE - If file already exists it will be truncated
- 0x20 - FSManager_APPEND - Open in append mode
- 0x40 - FSManager_NOFOLLOW - If pathname is a symbolic link, then the open fails. Symbolic links in earlier components of the pathname will still be followed
- 0x80 - FSManager_DIRECTORY - If pathname is not a directory, then the open fails
FSManager_READ or FSManager_WRITE must be set, others can be added. (FSManager_WRITE + FSManager_CREATE, for instance).
In case prop has FSManager_CREATE, prop can have the follow values too (in octal):
- 070000000 - FSManager_O_USER_RWX - file owner has read, write and execute permission
- 040000000 - FSManager_O_USER_READ - file owner has read permission
- 020000000 - FSManager_O_USER_WRITE - file owner has write permission
- 010000000 - FSManager_O_USER_EXEC - file owner has execute permission
- 007000000 - FSManager_O_GROUP_RWX - group has read, write and execute permission
- 004000000 - FSManager_O_GROUP_READ - group has read permission
- 002000000 - FSManager_O_GROUP_WRITE - group has write permission
- 001000000 - FSManager_O_GROUP_EXEC - group has execute permission
- 000700000 - FSManager_O_OTHERS_RWX - others have read, write and execute permission
- 000400000 - FSManager_O_OTHERS_READ - others have read permission
- 000200000 - FSManager_O_OTHERS_WRITE - others have write permission
- 000100000 - FSManager_O_OTHERS_EXEC - others have execute permission
If pathname isn't a complete path, that is, starts with "/" current directory will be used.
The file offset is set to the beginning of the file.
Return value
- >= 0 - file handler
- -E_BAD_VALUE - Invalid argument
- -E_NOT_FOUND - pathname doesn't exist
- -E_TOO_MANY_OPEN_FILES - Too many open files
- -E_NOT_FILE_DIR - pathname is not a file/directory (it is a socket, block device etc)
- -E_NOT_A_DIRECTORY - pathname is not a directory and FSManager_DIRECTORY was set
- -E_READ_ONLY_FS - Read only file system
- -E_NO_MEMORY - Not enough memory available
- -E_FILE_EXISTS - pathname already exists and FSManager_CREATE and FSManager_EXCLUSIVE were set
- -E_TOO_BIG - pathname is too big
- -E_NOT_A_DIRECTORY - A component of pathname is not a directory
- -E_FAULT - pathname points outside task's accessible address space
- -E_PERMISSION_DENIED - Permission denied
- -E_FS_FULL - File system is full
- -E_IO_ERROR - I/O error
- -E_LOOP - Too many symbolic links encountered while traversing pathname
- -E_FILE_ERROR - Undefined error
0x14 - URead
Syntax
int FSManager_URead(int fd, void *buf, int size);
Properties
User modules
Description
This function reads size bytes from fd into buf.
In case of directory read, buf will have dir entries (FSManager_DirEntry).
If all goes ok, file position is advanced by the number of bytes read.
Return value
- >= 0 - Number of bytes read
- -E_BAD_VALUE - Invalid fd or not opened for reading or size less than 0
- -E_END_REACHED - End of file reached
- -E_FAULT - buf points outside task's accessible address space
- -E_IO_ERROR - I/O error
- -E_FILE_ERROR - Undefined error
0x16 - URemove
Syntax
int FSManager_URemove(const char *pathname);
Properties
User modules
Description
This function removes pathname.
If pathname isn't a complete path, that is, starts with "/" current directory will be used.
The file/directory pathname can be been used. Who is using it can continue to use, but won't be possible to open, list, etc.
A directory with files can't be removed.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_READ_ONLY_FS - Read only file system
- E_NOT_FOUND - pathname doesn't exist
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - pathname is too big
- E_NOT_A_DIRECTORY - A component of pathname is not a directory
- E_FAULT - pathname points outside task's accessible address space
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing pathname
- E_FILE_ERROR - Undefined error
- E_NOT_EMPTY - Directory is not empty
- E_BUSY - pathname is the root directory of some task
0x18 - URewindDir
Syntax
int FSManager_URewindDir(int fd);
Properties
User modules
Description
This function repositions fd read offset to the beginning.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid fd
- E_NOT_A_DIRECTORY - fd is not a directory
- E_FILE_ERROR - Undefined error
0x19 - USeek
Syntax
int FSManager_USeek(int fd, int count, int prop);
Properties
User modules
Description
This functions repositions fd read/write offset to count bytes according to prop.
prop can be:
- 0x01 - FSManager_SEEK_START - relative to the beginning of file
- 0x02 - FSManager_SEEK_CURRENT - relative to current position
- 0x04 - FSManager_SEEK_END - relative to the end of file
Return value
- >= 0 - New file position
- -E_BAD_VALUE - Invalid fd or prop
- -E_NOT_ALLOWED - Operation not allowed
- -E_TOO_BIG - Final position is bigger than maximum allowed
- -E_IS_A_DIRECTORY - fd is a directory
- -E_FILE_ERROR - Undefined error
0x1a - UStatus
Syntax
int FSManager_UStatus(const char *pathname, FSManager_EntryStatus *buf, int prop);
Properties
User modules
Description
This function gets informations about pathname and puts them in buf.
prop can be:
- 0x01 - FSManager_STATUS_LINK - get symbolic link information, if pathname is a symbolic link
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_NOT_FOUND - pathname doesn't exist
- E_NOT_A_DIRECTORY - A component of pathname is not a directory
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - pathname is too big
- E_FAULT - pathname or buf points outside task's accessible address space
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing pathname
- E_FILE_ERROR - Undefined error
0x04 - UStatusFD
Syntax
int FSManager_UStatusFD(int fd, FSManager_EntryStatus *buf, int prop);
Properties
User modules
Description
This function gets informations about fd, which must have been opened by UOpen, and puts them in buf.
prop is not used yet.
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_NO_MEMORY - Not enough memory available
- E_IO_ERROR - I/O error
- E_FILE_ERROR - Undefined error
0x1b - UUnmount
Syntax
int FSManager_UUnmount(const char *path, int prop);
Properties
User modules
Description
This function unmounts the file system mounted in path.
prop can be zero or the sum of:
- 0x01 - FSManager_FORCE_UNMOUNT - force file system unmount
- 0x0100 - FSManager_UNMOUNT_PERMANENT - don't mount it permanently anymore
Return value
- E_OK - Success
- E_BAD_VALUE - Invalid argument
- E_IN_USE - File system in use
- E_NO_MEMORY - Not enough memory available
- E_TOO_BIG - path is too big
- E_NOT_FOUND - path doesn't exist
- E_NOT_A_DIRECTORY - A component of path is not a directory
- E_FAULT - path points outside task's accessible address space
- E_PERMISSION_DENIED - Permission denied
- E_IO_ERROR - I/O error
- E_LOOP - Too many symbolic links encountered while traversing path
- E_FILE_ERROR - Undefined error
0x1c - UWrite
Syntax
int FSManager_UWrite(int fd, void *buf, int count);
Properties
User modules
Description
This function writes count bytes from buf in fd.
If all goes ok, file position is advanced by the number of bytes written.
Return value
- >= 0 - Number of bytes written
- -E_BAD_VALUE - Invalid fd or not opened for writing
- -E_FS_FULL - File system is full
- -E_IS_A_DIRECTORY - fd is a directory
- -E_FAULT - buf points outside task's accessible address space
- -E_READ_ONLY_FS - Read only file system
- -E_IO_ERROR - I/O error
- -E_FILE_ERROR - Undefined error