|
OSAPI
0.29
Open System API
|
The file system module. More...

Functions | |
| t_status | fs_module_supported (void) |
| Declares if the module is supported on the current implementation. More... | |
| t_status | fs_path_getAbsolute (const t_char *source, t_size tsize, t_char *target) |
| Get an absolute path from a given path name. More... | |
| t_status | fs_directory_open (const t_char *path, t_dir *dir) |
| Open a directory. More... | |
| t_status | fs_directory_close (t_dir *dir) |
| Close a directory. More... | |
| t_status | fs_directory_create (const t_char *path, const char **mode) |
| Create a new directory. More... | |
| t_status | fs_directory_copy (const t_char *source, const t_char *target, bool overwrite) |
| Copy an entire directory onto another. More... | |
| t_status | fs_directory_updateInfo (t_dir *dir) |
| Obtain a directory descriptor. More... | |
| t_status | fs_directory_getElement (t_dir *dir, t_element *elem) |
| Obtain an element descriptor from a directory descriptor. More... | |
| t_status | fs_directory_getNumberElements (t_dir *dir, t_size *number) |
| Get the number of directory elements. More... | |
| t_status | fs_directory_getElementList (t_dir *dir, t_list *dirList) |
| Get the list of directory elements. More... | |
| t_status | fs_direntry_copy (const t_dir_entry *source, t_dir_entry *target) |
| Copy a directory entry information. More... | |
| t_status | fs_direntry_get (const t_list *list, t_size member, t_dir_entry *entry) |
| Retrieve a directory entry from a t_list. More... | |
| t_status | fs_direntry_getName (const t_dir_entry *entry, t_size nameSize, t_char *name) |
| Get the name of a directory entry. More... | |
| t_status | fs_direntry_getType (t_dir_entry *entry, t_fs_eType *type) |
| Get the type of a directory entry. More... | |
| t_status | fs_element_open (const char *path, t_element *element) |
| Open a file system element descriptor. More... | |
| t_status | fs_element_close (t_element *element) |
| Close a file system element descriptor. More... | |
| t_status | fs_element_remove (const char *path) |
| Eliminate a an element from the file system. More... | |
| t_status | fs_element_copy (const t_char *source, const t_char *target, bool overwrite) |
| Extended element copy operation If the destination already exists, it will be overwritten if the respective parameter is set to true. More... | |
| t_status | fs_element_move (const t_char *source, const t_char *target) |
| Move an element If the destination already exists, it will overwrite it. More... | |
| t_status | fs_element_same (const t_char *path1, const t_char *path2, bool *result) |
| Test if two file system paths are the same element. More... | |
| t_status | fs_element_exists (const char *path, bool *exists) |
| Does such element exists in the path. More... | |
| t_status | fs_element_setUID (const char *path, t_uid uid) |
| Change the user owning the element. More... | |
| t_status | fs_element_setGID (const char *path, t_gid gid) |
| Change the group owning the element. More... | |
| t_status | fs_element_setPermissions (const char *path, t_fs_perm *perm) |
| Change the permissions of the the element. More... | |
| t_status | fs_element_updateInfo (t_element *element) |
| Update the generic information about a file system element. More... | |
| t_status | fs_element_getType (const t_char *path, t_fs_eType *type) |
| Get type of element through a path name. More... | |
| t_status | fs_element_getName (const char *path, char **name) |
| Obtain the full pathname to element The returned name pointer is only valid as long as info is available. More... | |
| t_status | fs_element_getID (const char *path, t_fs_eid *id) |
| Obtain the element unique identifier on the file system. More... | |
| t_status | fs_element_getUID (const char *path, t_uid *uid) |
| Obtain the user ID owning the element. More... | |
| t_status | fs_element_getGID (const char *path, t_gid *gid) |
| Obtain the group ID owning the element. More... | |
| t_status | fs_element_getAccessTime (const char *path, t_time *atime) |
| Get element access time. More... | |
| t_status | fs_element_getCreationTime (const char *path, t_time *btime) |
| Get element creation/birth time. More... | |
| t_status | fs_element_getChangetime (const char *path, t_time *ctime) |
| Get element change time. More... | |
| t_status | fs_element_getModificationTime (const char *path, t_time *mtime) |
| Get element modification time. More... | |
| t_status | fs_element_getSize (const char *path, t_size *size) |
| Get size of element in the file system. More... | |
| t_status | fs_element_getPermissions (const char *path, t_fs_perm *perm) |
| Obtain the permissions of the element. More... | |
| t_status | fs_elementID_equal (t_fs_eid *id1, t_fs_eid *id2, bool *result) |
| Compare two file system element identifiers. More... | |
| t_status | fs_elementID_copy (t_fs_eid *source, t_fs_eid *target) |
| Copy an element ID. More... | |
| t_status | fs_elementID_get (const t_char *path, t_fs_eid *id) |
| Obtain the element unique identifier on the file system element. More... | |
| t_status | fs_elementInfo_getType (const t_element *element, int *type) |
| Get type of element. More... | |
| t_status | fs_elementInfo_getName (const t_element *element, char **name) |
| Obtain the element name (basename) The returned name pointer is only valid as long as info is available. More... | |
| t_status | fs_elementInfo_getPath (const t_element *element, const char **pathname) |
| Obtain the full pathname to element The returned name pointer is only valid as long as info is available. More... | |
| t_status | fs_elementInfo_getDirName (const t_element *element, t_size size, char *name) |
| Obtain the full pathname to element The returned name pointer is only valid as long as info is available. More... | |
| t_status | fs_elementInfo_getID (const t_element *element, t_fs_eid *id) |
| Obtain the element unique identifier on the file system. More... | |
| t_status | fs_elementInfo_getUID (const t_element *element, t_uid *uid) |
| Obtain the user ID owning the element. More... | |
| t_status | fs_elementInfo_getGID (const t_element *element, t_gid *gid) |
| Obtain the group ID owning the element. More... | |
| t_status | fs_elementInfo_getAccessTime (const t_element *element, t_time *atime) |
| Get element access time. More... | |
| t_status | fs_elementInfo_getCreationTime (const t_element *info, t_time *btime) |
| Get element creation/birth time. More... | |
| t_status | fs_elementInfo_getChangetime (const t_element *info, t_time *ctime) |
| Get element change time. More... | |
| t_status | fs_elementInfo_getModificationTime (const t_element *info, t_time *mtime) |
| Get element modification time. More... | |
| t_status | fs_elementInfo_getSize (const t_element *element, t_size *size) |
| Get size of element in the file system. More... | |
| t_status | fs_elementInfo_getPermissions (const t_element *element, t_fs_perm *perm) |
| Obtain the permissions of the element. More... | |
| t_status | fs_file_open (const t_char *path, const char **mode, t_file *file) |
| Open a file with fine grain control. More... | |
| t_status | fs_file_updateInfo (t_file *file) |
| Obtain a file descriptor. More... | |
| t_status | fs_file_openRead (const t_char *path, t_file *file) |
| Open a file for Reading Location at the beginning and no file creation. More... | |
| t_status | fs_file_openWrite (const t_char *path, t_file *file) |
| Open a file for Writing Location at the end and file created if doesn't exist. More... | |
| t_status | fs_file_openReadWrite (const t_char *path, t_file *file) |
| Open a file for Reading and Writing Location at the beginning for reading and at the end for writing. File is created if it doesn't exist. More... | |
| t_status | fs_file_create (const char *path, const char **mode) |
| Create a new file File is created but not opened. More... | |
| t_status | fs_file_copy (const t_char *source, const t_char *target, bool overwrite) |
| Copy a file element If the destination already exists, it will overwrite it. More... | |
| t_status | fs_file_setPosition (const t_file *file, int initial, t_offset offset) |
| Position the file stream according The file position is provided by the start location (begin, end of file) and the displacement offset. More... | |
| t_status | fs_file_setPositionBegin (const t_file *file) |
| Position the file stream on the beginning of the file Helper function for fs_file_setPosition. More... | |
| t_status | fs_file_setPositionEnd (const t_file *file) |
| Position the file pointer on the end Helper function for fs_file_setPosition. More... | |
| t_status | fs_file_setPositionAt (const t_file *file, t_offset distance) |
| Position the file pointer at the location from the beggining of the file Helper function for fs_file_setPosition. More... | |
| t_status | fs_file_setBlockSize (t_file *file, t_size size) |
| Change the block size for file operations Helper function for fs_file_setPosition. More... | |
| t_status | fs_file_close (t_file *file) |
| Close a file. More... | |
| t_status | fs_file_read (const t_file *file, t_buffer *buffer, bool *eof) |
| Read a file content into a given buffer. More... | |
| t_status | fs_file_write (const t_file *file, t_buffer *buffer) |
| Read a file content into a given buffer. More... | |
| t_status | fs_file_getElement (t_file *file, t_element *elem) |
| Obtain an element descriptor from a file descriptor. More... | |
| t_status | fs_id_get (const t_char *path, t_fs_id *id) |
| Open a file with fine grain control. More... | |
| t_status | fs_id_equal (t_fs_id *id1, t_fs_id *id2, bool *result) |
| Compare two file system identifiers. More... | |
| t_status | fs_id_same (const t_char *path1, const t_char *path2) |
| Compare two file system identifiers. More... | |
| t_status | fs_id_copy (t_fs_id *source, t_fs_id *target) |
| Copy a FS ID. More... | |
| t_status | fs_link_open (const t_char *path, t_link *link) |
| Open a link. More... | |
| t_status | fs_link_close (t_link *p_link) |
| Close a link. More... | |
| t_status | fs_link_createSoft (const t_char *source, const t_char *target, bool overwrite) |
| Create a new soft link. More... | |
| t_status | fs_link_createHard (const t_char *source, const t_char *target, bool overwrite) |
| Create a new hard link. More... | |
| t_status | fs_link_copy (const t_char *source, const t_char *target, bool overwrite) |
| Copy a link element If there is a destination, link creation fails. More... | |
| t_status | fs_link_updateInfo (t_link *link) |
| Obtain a link descriptor from a path name. More... | |
| t_status | fs_link_getElement (const t_link *link, t_element *elem) |
| Obtain an element descriptor from a link descriptor. More... | |
| t_status | fs_link_getTarget (const t_link *link, const t_char **target) |
| Obtain the target of the link The function will return the address of the string that contains the target name. This address will not be valid after a call to fs_link_close. More... | |
| t_status | fs_link_getName (const t_link *link, const t_char **name) |
| Obtain the name of the link. More... | |
The file system module.
Close a directory.
| [in] | dir | - Directory descriptor |
Copy an entire directory onto another.
| [in] | source | - Source directory name |
| [in] | target | - Destination directory name |
| [in] | overwrite | - If destination exists, overwrite it? |

Create a new directory.
| [in] | path | - Directory name |
| [in] | mode | - Directory creation options |
Obtain an element descriptor from a directory descriptor.
| [in] | dir | - Directory descriptor |
| [out] | elem | - Element descriptor |
Get the list of directory elements.
| [in] | dir | - Directory descriptor |
| [out] | dirList | - The retrieved directory list |
Get the number of directory elements.
| [in] | dir | - Directory descriptor |
| [out] | number | - Number of directory elements |
Open a directory.
| [in] | path | - Directory name |
| [out] | dir | - New directory descriptor |
Obtain a directory descriptor.
| [out] | dir | - Directory descriptor |
| t_status fs_direntry_copy | ( | const t_dir_entry * | source, |
| t_dir_entry * | target | ||
| ) |
Copy a directory entry information.
| [in] | source | - Source directory entry |
| [out] | target | - Destination directory entry |
Retrieve a directory entry from a t_list.
| [in] | list | - A "t_list" |
| [in] | member | - The list member to retrieve |
| [out] | entry | - The directory entry |
Get the name of a directory entry.
| [in] | entry | - Directory entry information |
| [in] | nameSize | - Size of storage for the file system name |
| [out] | name | - Name of file system element |
| t_status fs_direntry_getType | ( | t_dir_entry * | entry, |
| t_fs_eType * | type | ||
| ) |
Get the type of a directory entry.
| [in] | entry | - Directory entry |
| [out] | type | - The type of element for the specified entry |
Close a file system element descriptor.
| [out] | element | - File element descriptor |

Extended element copy operation If the destination already exists, it will be overwritten if the respective parameter is set to true.
| [in] | source | - Copy from |
| [in] | target | - Copy into |
| [in] | overwrite | - Overwrite target? |

| t_status fs_element_exists | ( | const char * | path, |
| bool * | exists | ||
| ) |
Does such element exists in the path.
| [in] | path | - Path name of element |
| [out] | exists | - Result of element search |
Get element access time.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | atime | - Last element access time |
Get element change time.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | ctime | - Element creation time |
Get element creation/birth time.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | btime | - Element creation time |
| t_status fs_element_getGID | ( | const char * | path, |
| t_gid * | gid | ||
| ) |
Obtain the group ID owning the element.
| [in] | path | - Pathname from which to retrieve the group ID |
| [out] | gid | - Current User ID of filesystem element |
Obtain the element unique identifier on the file system.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | id | - Current ID of the file system element |
Get element modification time.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | mtime | - Last element modification time |
| t_status fs_element_getName | ( | const char * | path, |
| char ** | name | ||
| ) |
Obtain the full pathname to element The returned name pointer is only valid as long as info is available.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | name | - The element name |
Obtain the permissions of the element.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | perm | - Current permissions of element |
Get size of element in the file system.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | size | - Size of element |
Get type of element through a path name.
| [in] | path | - Pathname from which to retrieve the information |
| [out] | type | - Type of element |

| t_status fs_element_getUID | ( | const char * | path, |
| t_uid * | uid | ||
| ) |
Obtain the user ID owning the element.
| [in] | path | - Pathname from which to retrieve the user ID |
| [out] | uid | - Current User ID of file system element |
Move an element If the destination already exists, it will overwrite it.
| [in] | source | - Move from |
| [in] | target | - Move into |
Open a file system element descriptor.
| [in] | path | - Path name to the file system element |
| [out] | element | - File element descriptor |
| t_status fs_element_remove | ( | const char * | path | ) |
Eliminate a an element from the file system.
| [in] | path | - Path name to element |
Test if two file system paths are the same element.
| [in] | path1 | - Path name of element 1 |
| [in] | path2 | - Path name of element 2 |
| [out] | result | - The comparison result |
| t_status fs_element_setGID | ( | const char * | path, |
| t_gid | gid | ||
| ) |
Change the group owning the element.
| [in] | path | - Pathname to element |
| [in] | gid | - New Group ID |
Change the permissions of the the element.
| [in] | path | - Pathname to element |
| [in] | perm | - New set of element permissions |
| t_status fs_element_setUID | ( | const char * | path, |
| t_uid | uid | ||
| ) |
Change the user owning the element.
| [in] | path | - Pathname to element |
| [in] | uid | - New User ID |
Update the generic information about a file system element.
| [in,out] | element | - Structure containing the file system element information |
Copy an element ID.
| [in] | source | - Copy from |
| [in] | target | - Copy into |
Compare two file system element identifiers.
| [in] | id1 | - File system identifier |
| [in] | id2 | - File system identifier |
| [out] | result | - Comparison result |
Obtain the element unique identifier on the file system element.
| [in] | path | - Path name to the file system element |
| [out] | id | - Current ID of the file system element |
Get element access time.
| [in] | element | - File system element information |
| [out] | atime | - Last element access time |
Get element change time.
| [in] | info | - File system element information |
| [out] | ctime | - Element creation time |
Get element creation/birth time.
| [in] | info | - File system element information |
| [out] | btime | - Element creation time |
Obtain the full pathname to element The returned name pointer is only valid as long as info is available.
| [in] | element | - Structure containing the file system element information |
| [in] | size | - Size of the output name string |
| [out] | name | - The directory where the element resides |
Obtain the group ID owning the element.
| [in] | element | - Structure containing the file system element information |
| [out] | gid | - Current User ID of filesystem element |
Obtain the element unique identifier on the file system.
| [in] | element | - Structure containing the file system element information |
| [out] | id | - Current ID of the file system element |
Get element modification time.
| [in] | info | - File system element information |
| [out] | mtime | - Last element modification time |
Obtain the element name (basename) The returned name pointer is only valid as long as info is available.
| [in] | element | - Structure containing the file system element information |
| [out] | name | - The element name |
Obtain the full pathname to element The returned name pointer is only valid as long as info is available.
| [in] | element | - Structure containing the file system element information |
| [out] | pathname | - The full path to element |
Obtain the permissions of the element.
| [in] | element | - Structure containing the file system element information |
| [out] | perm | - Current permissions of element |
Get size of element in the file system.
| [in] | element | - File system element information |
| [out] | size | - Size of element |
Get type of element.
| [in] | element | - File system element information |
| [out] | type | - Type of element |
Obtain the user ID owning the element.
| [in] | element | - Structure containing the file system element information |
| [out] | uid | - Current User ID of file system element |
Close a file.
| [in] | file | - File descriptor |
Copy a file element If the destination already exists, it will overwrite it.
| [in] | source | - Copy from |
| [in] | target | - Copy into |
| [in] | overwrite | - If file exists, overwrite it ? |

| t_status fs_file_create | ( | const char * | path, |
| const char ** | mode | ||
| ) |
Create a new file File is created but not opened.
| [in] | path | - File name |
| [in] | mode | - File creation options (array of string options specific to each OS) |
Obtain an element descriptor from a file descriptor.
| [in] | file | - File descriptor |
| [out] | elem | - Element descriptor |
Open a file with fine grain control.
| [in] | path | - File name |
| [in] | mode | - File open mode options (specific to each OS) |
| [out] | file | - New file descriptor |
Open a file for Reading Location at the beginning and no file creation.
| [in] | path | - File name |
| [out] | file | - New file descriptor |
Open a file for Reading and Writing Location at the beginning for reading and at the end for writing. File is created if it doesn't exist.
| [in] | path | - File name |
| [out] | file | - New file descriptor |
Open a file for Writing Location at the end and file created if doesn't exist.
| [in] | path | - File name |
| [out] | file | - New file descriptor |
Read a file content into a given buffer.
| [in] | file | - File descriptor |
| [out] | buffer | - Buffer to where to read into |
| [out] | eof | - Have we finish reading the file |
Change the block size for file operations Helper function for fs_file_setPosition.
| [in] | file | - File descriptor |
| [in] | size | - New file block size |
Position the file stream according The file position is provided by the start location (begin, end of file) and the displacement offset.
| [in] | file | - File descriptor |
| [in] | initial | - Initial position |
| [in] | offset | - Offset of the initial position |

Position the file pointer at the location from the beggining of the file Helper function for fs_file_setPosition.
| [in] | file | - File descriptor |
| [in] | distance | - Set current file position at a distance from the file beginning |

Position the file stream on the beginning of the file Helper function for fs_file_setPosition.
| [in] | file | - File descriptor |

Position the file pointer on the end Helper function for fs_file_setPosition.
| [in] | file | - File descriptor |

Obtain a file descriptor.
| [in,out] | file | - File descriptor |
Read a file content into a given buffer.
| [in] | file | - File descriptor |
| [in] | buffer | - Buffer to write to file |
Copy a FS ID.
| [in] | source | - Source file system identifier |
| [in] | target | - Destination file system identifier |
Compare two file system identifiers.
| [in] | id1 | - ile system identifier |
| [in] | id2 | - ile system identifier |
| [out] | result | - Comparison result |
Open a file with fine grain control.
| [in] | path | - Name of a file system location |
| [out] | id | - File system identifier |
Compare two file system identifiers.
| [in] | path1 | - Name of a file system location |
| [in] | path2 | - Name of a file system location |
Close a link.
| [in] | p_link | - Link descriptor (pointer) |

Copy a link element If there is a destination, link creation fails.
| [in] | source | - Copy from |
| [in] | target | - Copy into |
| [in] | overwrite | - If file exists, overwrite it ? |

Create a new hard link.
| [in] | source | - New link name |
| [in] | target | - Link target |
| [in] | overwrite | - If link exists, overwrite it (if true) |
Create a new soft link.
| [in] | source | - New link name |
| [in] | target | - Link target |
| [in] | overwrite | - If link exists, overwrite it (if true) |
Obtain an element descriptor from a link descriptor.
| [in] | link | - Link descriptor |
| [out] | elem | - Element descriptor |
Obtain the name of the link.
| [in] | link | - Link descriptor |
| [out] | name | - Name of link |
Obtain the target of the link The function will return the address of the string that contains the target name. This address will not be valid after a call to fs_link_close.
| [in] | link | - Link descriptor |
| [out] | target | - Address of the link target |
Open a link.
| [in] | path | - Link name |
| [out] | link | - New link descriptor |
Obtain a link descriptor from a path name.
| [out] | link | - Link descriptor |
| t_status fs_module_supported | ( | void | ) |
Declares if the module is supported on the current implementation.