OSAPI  0.29
Open System API

The file system module. More...

Collaboration diagram for FS:

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...
 

Detailed Description

The file system module.


Function Documentation

◆ fs_directory_close()

t_status fs_directory_close ( t_dir dir)

Close a directory.

Parameters
[in]dir- Directory descriptor
Returns
SUCCESS if directory descriptor closed. An error condition otherwise.

◆ fs_directory_copy()

t_status fs_directory_copy ( const t_char source,
const t_char target,
bool  overwrite 
)

Copy an entire directory onto another.

Parameters
[in]source- Source directory name
[in]target- Destination directory name
[in]overwrite- If destination exists, overwrite it?
Returns
SUCCESS if copied. An error condition otherwise.
Here is the caller graph for this function:

◆ fs_directory_create()

t_status fs_directory_create ( const t_char path,
const char **  mode 
)

Create a new directory.

Parameters
[in]path- Directory name
[in]mode- Directory creation options
Returns
SUCCESS if created. An error condition otherwise (e.g. An element already exists with that name).

◆ fs_directory_getElement()

t_status fs_directory_getElement ( t_dir dir,
t_element elem 
)

Obtain an element descriptor from a directory descriptor.

Parameters
[in]dir- Directory descriptor
[out]elem- Element descriptor
Returns
Operation status.

◆ fs_directory_getElementList()

t_status fs_directory_getElementList ( t_dir dir,
t_list dirList 
)

Get the list of directory elements.

Parameters
[in]dir- Directory descriptor
[out]dirList- The retrieved directory list
Returns
Operation status.

◆ fs_directory_getNumberElements()

t_status fs_directory_getNumberElements ( t_dir dir,
t_size number 
)

Get the number of directory elements.

Parameters
[in]dir- Directory descriptor
[out]number- Number of directory elements
Returns
Operation status.

◆ fs_directory_open()

t_status fs_directory_open ( const t_char path,
t_dir dir 
)

Open a directory.

Parameters
[in]path- Directory name
[out]dir- New directory descriptor
Returns
SUCCESS if directory descriptor opened. An error condition otherwise.

◆ fs_directory_updateInfo()

t_status fs_directory_updateInfo ( t_dir dir)

Obtain a directory descriptor.

Parameters
[out]dir- Directory descriptor
Returns
SUCCESS if created. An error condition otherwise (e.g. An element already exists with that name).

◆ fs_direntry_copy()

t_status fs_direntry_copy ( const t_dir_entry *  source,
t_dir_entry *  target 
)

Copy a directory entry information.

Parameters
[in]source- Source directory entry
[out]target- Destination directory entry
Returns
SUCCESS if copied. An error condition otherwise.

◆ fs_direntry_get()

t_status fs_direntry_get ( const t_list list,
t_size  member,
t_dir_entry *  entry 
)

Retrieve a directory entry from a t_list.

Parameters
[in]list- A "t_list"
[in]member- The list member to retrieve
[out]entry- The directory entry
Returns
Operation status.

◆ fs_direntry_getName()

t_status fs_direntry_getName ( const t_dir_entry *  entry,
t_size  nameSize,
t_char name 
)

Get the name of a directory entry.

Parameters
[in]entry- Directory entry information
[in]nameSize- Size of storage for the file system name
[out]name- Name of file system element
Returns
Operation status.

◆ fs_direntry_getType()

t_status fs_direntry_getType ( t_dir_entry *  entry,
t_fs_eType *  type 
)

Get the type of a directory entry.

Parameters
[in]entry- Directory entry
[out]type- The type of element for the specified entry
Returns
Operation status.

◆ fs_element_close()

t_status fs_element_close ( t_element element)

Close a file system element descriptor.

Parameters
[out]element- File element descriptor
Returns
Operation status
Here is the caller graph for this function:

◆ fs_element_copy()

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.

Parameters
[in]source- Copy from
[in]target- Copy into
[in]overwrite- Overwrite target?
Returns
SUCCESS if copied. An error condition otherwise.
Here is the call graph for this function:

◆ fs_element_exists()

t_status fs_element_exists ( const char *  path,
bool *  exists 
)

Does such element exists in the path.

Parameters
[in]path- Path name of element
[out]exists- Result of element search
Returns
Operation status.

◆ fs_element_getAccessTime()

t_status fs_element_getAccessTime ( const char *  path,
t_time atime 
)

Get element access time.

Parameters
[in]path- Pathname from which to retrieve the information
[out]atime- Last element access time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_element_getChangetime()

t_status fs_element_getChangetime ( const char *  path,
t_time ctime 
)

Get element change time.

Parameters
[in]path- Pathname from which to retrieve the information
[out]ctime- Element creation time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_element_getCreationTime()

t_status fs_element_getCreationTime ( const char *  path,
t_time btime 
)

Get element creation/birth time.

Parameters
[in]path- Pathname from which to retrieve the information
[out]btime- Element creation time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_element_getGID()

t_status fs_element_getGID ( const char *  path,
t_gid *  gid 
)

Obtain the group ID owning the element.

Parameters
[in]path- Pathname from which to retrieve the group ID
[out]gid- Current User ID of filesystem element
Returns
Operation status.

◆ fs_element_getID()

t_status fs_element_getID ( const char *  path,
t_fs_eid id 
)

Obtain the element unique identifier on the file system.

Parameters
[in]path- Pathname from which to retrieve the information
[out]id- Current ID of the file system element
Returns
Operation status.

◆ fs_element_getModificationTime()

t_status fs_element_getModificationTime ( const char *  path,
t_time mtime 
)

Get element modification time.

Parameters
[in]path- Pathname from which to retrieve the information
[out]mtime- Last element modification time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_element_getName()

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.

Parameters
[in]path- Pathname from which to retrieve the information
[out]name- The element name
Returns
Operation status.

◆ fs_element_getPermissions()

t_status fs_element_getPermissions ( const char *  path,
t_fs_perm perm 
)

Obtain the permissions of the element.

Parameters
[in]path- Pathname from which to retrieve the information
[out]perm- Current permissions of element
Returns
Operation status.

◆ fs_element_getSize()

t_status fs_element_getSize ( const char *  path,
t_size size 
)

Get size of element in the file system.

Parameters
[in]path- Pathname from which to retrieve the information
[out]size- Size of element
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_element_getType()

t_status fs_element_getType ( const t_char path,
t_fs_eType *  type 
)

Get type of element through a path name.

Parameters
[in]path- Pathname from which to retrieve the information
[out]type- Type of element
Returns
SUCCESS if it exists. An error condition otherwise.
Here is the caller graph for this function:

◆ fs_element_getUID()

t_status fs_element_getUID ( const char *  path,
t_uid *  uid 
)

Obtain the user ID owning the element.

Parameters
[in]path- Pathname from which to retrieve the user ID
[out]uid- Current User ID of file system element
Returns
Operation status.

◆ fs_element_move()

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.

Parameters
[in]source- Move from
[in]target- Move into
Returns
SUCCESS if moved. An error condition otherwise.

◆ fs_element_open()

t_status fs_element_open ( const char *  path,
t_element element 
)

Open a file system element descriptor.

Parameters
[in]path- Path name to the file system element
[out]element- File element descriptor
Returns
Operation status

◆ fs_element_remove()

t_status fs_element_remove ( const char *  path)

Eliminate a an element from the file system.

Parameters
[in]path- Path name to element
Returns
SUCCESS if removed. An error condition otherwise.

◆ fs_element_same()

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.

Parameters
[in]path1- Path name of element 1
[in]path2- Path name of element 2
[out]result- The comparison result
Returns
Operation status.

◆ fs_element_setGID()

t_status fs_element_setGID ( const char *  path,
t_gid  gid 
)

Change the group owning the element.

Parameters
[in]path- Pathname to element
[in]gid- New Group ID
Returns
Operation status.

◆ fs_element_setPermissions()

t_status fs_element_setPermissions ( const char *  path,
t_fs_perm perm 
)

Change the permissions of the the element.

Parameters
[in]path- Pathname to element
[in]perm- New set of element permissions
Returns
Operation status.

◆ fs_element_setUID()

t_status fs_element_setUID ( const char *  path,
t_uid  uid 
)

Change the user owning the element.

Parameters
[in]path- Pathname to element
[in]uid- New User ID
Returns
Operation status.

◆ fs_element_updateInfo()

t_status fs_element_updateInfo ( t_element element)

Update the generic information about a file system element.

Parameters
[in,out]element- Structure containing the file system element information
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementID_copy()

t_status fs_elementID_copy ( t_fs_eid source,
t_fs_eid target 
)

Copy an element ID.

Parameters
[in]source- Copy from
[in]target- Copy into
Returns
SUCCESS if copied. An error condition otherwise.

◆ fs_elementID_equal()

t_status fs_elementID_equal ( t_fs_eid id1,
t_fs_eid id2,
bool *  result 
)

Compare two file system element identifiers.

Parameters
[in]id1- File system identifier
[in]id2- File system identifier
[out]result- Comparison result
Returns
Operation status.

◆ fs_elementID_get()

t_status fs_elementID_get ( const t_char path,
t_fs_eid id 
)

Obtain the element unique identifier on the file system element.

Parameters
[in]path- Path name to the file system element
[out]id- Current ID of the file system element
Returns
Operation status.

◆ fs_elementInfo_getAccessTime()

t_status fs_elementInfo_getAccessTime ( const t_element element,
t_time atime 
)

Get element access time.

Parameters
[in]element- File system element information
[out]atime- Last element access time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementInfo_getChangetime()

t_status fs_elementInfo_getChangetime ( const t_element info,
t_time ctime 
)

Get element change time.

Parameters
[in]info- File system element information
[out]ctime- Element creation time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementInfo_getCreationTime()

t_status fs_elementInfo_getCreationTime ( const t_element info,
t_time btime 
)

Get element creation/birth time.

Parameters
[in]info- File system element information
[out]btime- Element creation time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementInfo_getDirName()

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.

Parameters
[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
Returns
Operation status.

◆ fs_elementInfo_getGID()

t_status fs_elementInfo_getGID ( const t_element element,
t_gid *  gid 
)

Obtain the group ID owning the element.

Parameters
[in]element- Structure containing the file system element information
[out]gid- Current User ID of filesystem element
Returns
Operation status.

◆ fs_elementInfo_getID()

t_status fs_elementInfo_getID ( const t_element element,
t_fs_eid id 
)

Obtain the element unique identifier on the file system.

Parameters
[in]element- Structure containing the file system element information
[out]id- Current ID of the file system element
Returns
Operation status.

◆ fs_elementInfo_getModificationTime()

t_status fs_elementInfo_getModificationTime ( const t_element info,
t_time mtime 
)

Get element modification time.

Parameters
[in]info- File system element information
[out]mtime- Last element modification time
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementInfo_getName()

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.

Parameters
[in]element- Structure containing the file system element information
[out]name- The element name
Returns
Operation status.

◆ fs_elementInfo_getPath()

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.

Parameters
[in]element- Structure containing the file system element information
[out]pathname- The full path to element
Returns
Operation status.

◆ fs_elementInfo_getPermissions()

t_status fs_elementInfo_getPermissions ( const t_element element,
t_fs_perm perm 
)

Obtain the permissions of the element.

Parameters
[in]element- Structure containing the file system element information
[out]perm- Current permissions of element
Returns
Operation status.

◆ fs_elementInfo_getSize()

t_status fs_elementInfo_getSize ( const t_element element,
t_size size 
)

Get size of element in the file system.

Parameters
[in]element- File system element information
[out]size- Size of element
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementInfo_getType()

t_status fs_elementInfo_getType ( const t_element element,
int *  type 
)

Get type of element.

Parameters
[in]element- File system element information
[out]type- Type of element
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_elementInfo_getUID()

t_status fs_elementInfo_getUID ( const t_element element,
t_uid *  uid 
)

Obtain the user ID owning the element.

Parameters
[in]element- Structure containing the file system element information
[out]uid- Current User ID of file system element
Returns
Operation status.

◆ fs_file_close()

t_status fs_file_close ( t_file file)

Close a file.

Parameters
[in]file- File descriptor
Returns
SUCCESS if it exists. An error condition otherwise.

◆ fs_file_copy()

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.

Parameters
[in]source- Copy from
[in]target- Copy into
[in]overwrite- If file exists, overwrite it ?
Returns
SUCCESS if copied. An error condition otherwise.
Here is the caller graph for this function:

◆ fs_file_create()

t_status fs_file_create ( const char *  path,
const char **  mode 
)

Create a new file File is created but not opened.

Parameters
[in]path- File name
[in]mode- File creation options (array of string options specific to each OS)
Returns
SUCCESS if created. An error condition otherwise (e.g. file already exists).

◆ fs_file_getElement()

t_status fs_file_getElement ( t_file file,
t_element elem 
)

Obtain an element descriptor from a file descriptor.

Parameters
[in]file- File descriptor
[out]elem- Element descriptor
Returns
Operation status.

◆ fs_file_open()

t_status fs_file_open ( const t_char path,
const char **  mode,
t_file file 
)

Open a file with fine grain control.

Parameters
[in]path- File name
[in]mode- File open mode options (specific to each OS)
[out]file- New file descriptor
Returns
SUCCESS if file opened. An error condition otherwise.

◆ fs_file_openRead()

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.

Parameters
[in]path- File name
[out]file- New file descriptor
Returns
SUCCESS if file opened. An error condition otherwise.

◆ fs_file_openReadWrite()

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.

Parameters
[in]path- File name
[out]file- New file descriptor
Returns
SUCCESS if file opened. An error condition otherwise.

◆ fs_file_openWrite()

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.

Parameters
[in]path- File name
[out]file- New file descriptor
Returns
SUCCESS if file opened. An error condition otherwise.

◆ fs_file_read()

t_status fs_file_read ( const t_file file,
t_buffer buffer,
bool *  eof 
)

Read a file content into a given buffer.

Parameters
[in]file- File descriptor
[out]buffer- Buffer to where to read into
[out]eof- Have we finish reading the file
Returns
SUCCESS if read. An error condition otherwise.

◆ fs_file_setBlockSize()

t_status fs_file_setBlockSize ( t_file file,
t_size  size 
)

Change the block size for file operations Helper function for fs_file_setPosition.

Parameters
[in]file- File descriptor
[in]size- New file block size
Returns
Operation status.

◆ fs_file_setPosition()

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.

Parameters
[in]file- File descriptor
[in]initial- Initial position
[in]offset- Offset of the initial position
Returns
SUCCESS if file positioned. An error condition otherwise.
Here is the caller graph for this function:

◆ fs_file_setPositionAt()

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.

Parameters
[in]file- File descriptor
[in]distance- Set current file position at a distance from the file beginning
Returns
SUCCESS if file positioned at distance. An error condition otherwise.
Here is the call graph for this function:

◆ fs_file_setPositionBegin()

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.

Parameters
[in]file- File descriptor
Returns
SUCCESS if file positioned on the begging of the file. An error condition otherwise.
Here is the call graph for this function:

◆ fs_file_setPositionEnd()

t_status fs_file_setPositionEnd ( const t_file file)

Position the file pointer on the end Helper function for fs_file_setPosition.

Parameters
[in]file- File descriptor
Returns
SUCCESS if file positioned on the end of file. An error condition otherwise.
Here is the call graph for this function:

◆ fs_file_updateInfo()

t_status fs_file_updateInfo ( t_file file)

Obtain a file descriptor.

Parameters
[in,out]file- File descriptor
Returns
SUCCESS if created. An error condition otherwise (e.g. An element already exists with that name).

◆ fs_file_write()

t_status fs_file_write ( const t_file file,
t_buffer buffer 
)

Read a file content into a given buffer.

Parameters
[in]file- File descriptor
[in]buffer- Buffer to write to file
Returns
SUCCESS if written. An error condition otherwise.

◆ fs_id_copy()

t_status fs_id_copy ( t_fs_id source,
t_fs_id target 
)

Copy a FS ID.

Parameters
[in]source- Source file system identifier
[in]target- Destination file system identifier
Returns
SUCCESS if IDs match. An error otherwise.

◆ fs_id_equal()

t_status fs_id_equal ( t_fs_id id1,
t_fs_id id2,
bool *  result 
)

Compare two file system identifiers.

Parameters
[in]id1- ile system identifier
[in]id2- ile system identifier
[out]result- Comparison result
Returns
SUCCESS if IDs match. An error otherwise.

◆ fs_id_get()

t_status fs_id_get ( const t_char path,
t_fs_id id 
)

Open a file with fine grain control.

Parameters
[in]path- Name of a file system location
[out]id- File system identifier
Returns
SUCCESS if file opened. An error condition otherwise.

◆ fs_id_same()

t_status fs_id_same ( const t_char path1,
const t_char path2 
)

Compare two file system identifiers.

Parameters
[in]path1- Name of a file system location
[in]path2- Name of a file system location
Returns
SUCCESS if IDs match. An error otherwise.

◆ fs_link_close()

t_status fs_link_close ( t_link p_link)

Close a link.

Parameters
[in]p_link- Link descriptor (pointer)
Returns
SUCCESS if descriptor closed. An error condition otherwise.
Here is the call graph for this function:

◆ fs_link_copy()

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.

Parameters
[in]source- Copy from
[in]target- Copy into
[in]overwrite- If file exists, overwrite it ?
Returns
SUCCESS if copied. An error condition otherwise.
Here is the caller graph for this function:

◆ fs_link_createHard()

t_status fs_link_createHard ( const t_char source,
const t_char target,
bool  overwrite 
)

Create a new hard link.

Parameters
[in]source- New link name
[in]target- Link target
[in]overwrite- If link exists, overwrite it (if true)
Returns
SUCCESS if created. An error condition otherwise.

◆ fs_link_createSoft()

t_status fs_link_createSoft ( const t_char source,
const t_char target,
bool  overwrite 
)

Create a new soft link.

Parameters
[in]source- New link name
[in]target- Link target
[in]overwrite- If link exists, overwrite it (if true)
Returns
SUCCESS if created. An error condition otherwise.

◆ fs_link_getElement()

t_status fs_link_getElement ( const t_link link,
t_element elem 
)

Obtain an element descriptor from a link descriptor.

Parameters
[in]link- Link descriptor
[out]elem- Element descriptor
Returns
Operation status.

◆ fs_link_getName()

t_status fs_link_getName ( const t_link link,
const t_char **  name 
)

Obtain the name of the link.

Parameters
[in]link- Link descriptor
[out]name- Name of link
Returns
SUCCESS if target name was obtained. Failure otherwise.

◆ fs_link_getTarget()

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.

Parameters
[in]link- Link descriptor
[out]target- Address of the link target
Returns
SUCCESS if target name was obtained. Failure otherwise.

◆ fs_link_open()

t_status fs_link_open ( const t_char path,
t_link link 
)

Open a link.

Parameters
[in]path- Link name
[out]link- New link descriptor
Returns
SUCCESS if link opened. An error condition otherwise.

◆ fs_link_updateInfo()

t_status fs_link_updateInfo ( t_link link)

Obtain a link descriptor from a path name.

Parameters
[out]link- Link descriptor
Returns
SUCCESS if information about the link was obtained. Failure otherwise.

◆ fs_module_supported()

t_status fs_module_supported ( void  )

Declares if the module is supported on the current implementation.

Returns
SUCCESS or FAILURE

◆ fs_path_getAbsolute()

t_status fs_path_getAbsolute ( const t_char source,
t_size  tsize,
t_char target 
)

Get an absolute path from a given path name.

Parameters
[in]source- Input path
[in]tsize- Size of the target buffer
[out]target- Output path
Returns
SUCCESS or FAILURE