vfs/path.h header reference
[Virtual File System module]

The source code of this header can be browsed online.

Description [link] 

Core file system node

Members [link] 

Functions [link] 

  • error_t vfs_create(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, enum vfs_node_type_e type, struct vfs_node_s **node)
  • void vfs_dump(struct vfs_node_s *root)
  • error_t vfs_link(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *src, const char *dst)
  • error_t vfs_lookup(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, struct vfs_node_s **node)
  • error_t vfs_open(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, enum vfs_open_flags_e flags, struct vfs_file_s **file)
  • error_t vfs_stat(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, struct vfs_stat_s *stat)
  • error_t vfs_unlink(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path)

Members detail [link] 

#define _VFS_PATH_H_ [link] 

This macro is declared in vfs/path.h source file, line 28.

error_t vfs_create(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, enum vfs_node_type_e type, struct vfs_node_s **node) [link] 

This function is declared in vfs/path.h source file, line 74.

this function creates a path relative to the parent node. The path may be a relative path with more than one directory member. For the node creation to succeed, parent of final node must already exist.

Parameter list:

  • root: Current root directory
  • cwd: Current base directory
  • path: Path of the node to create, relative (from cwd, or absolute from root). path may contain one or more '/'. It must end with a '\0'
  • node: Found node, if no error (return value)

The return value is 0 if created, or an error this function transfers the ownership to caller.

See also vfs_node_anon_create.

void vfs_dump(struct vfs_node_s *root) [link] 

This function is declared in vfs/path.h source file, line 156.

this function dumps the present tree state of VFS starting at root.

Parameter list:

  • root: Where to start dump from

error_t vfs_link(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *src, const char *dst) [link] 

This function is declared in vfs/path.h source file, line 149.

this function links a path to another

Parameter list:

  • root: Current root directory
  • cwd: Current base directory
  • src: Path of the node to link from, relative (from cwd, or absolute from root). path may contain one or more '/'. It must end with a '\0'
  • dst: Path of the node to link to, relative (from cwd, or absolute from root). path may contain one or more '/'. It must end with a '\0'

The return value is 0 if node was linked, or an error

See also vfs_node_unlink.

error_t vfs_lookup(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, struct vfs_node_s **node) [link] 

This function is declared in vfs/path.h source file, line 53.

this function gets a path relative to the parent node.

Parameter list:

  • root: Current root directory
  • cwd: Current base directory
  • path: Path of the node to lookup, relative (from cwd, or absolute from root) path may contain one or more '/'. It must end with a '\0'
  • node: Found node, if available (return value)

The return value is 0 if found, or an error this function transfers the ownership to caller.

See also vfs_node_lookup.

error_t vfs_open(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, enum vfs_open_flags_e flags, struct vfs_file_s **file) [link] 

This function is declared in vfs/path.h source file, line 98.

this function opens a path for reading and/or writing. If path is a directory, the only permitted operation is read (see ... for more information). If target node does not exist, it may be created if VFS_OPEN_CREATE is passed in flags. A directory cannot be created by this call.

Parameter list:

  • root: Current root directory
  • cwd: Current base directory
  • path: Path of the node to open, relative (from cwd, or absolute from root). path may contain one or more '/'. It must end with a '\0'
  • flags: Opening mode flags
  • file: Opened file descriptor, if succeeded

The return value is 0 if opened, or an error

See also vfs_node_open.

error_t vfs_stat(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path, struct vfs_stat_s *stat) [link] 

This function is declared in vfs/path.h source file, line 115.

this function retrieves information about a given file.

Parameter list:

  • root: Current root directory
  • cwd: Current base directory
  • path: Path of the node to open, relative (from cwd, or absolute from root). path may contain one or more '/'. It must end with a '\0'
  • stat: User-provided buffer to hold node information

The return value is 0 if node was found, or an error

See also vfs_node_stat.

error_t vfs_unlink(struct vfs_node_s *root, struct vfs_node_s *cwd, const char *path) [link] 

This function is declared in vfs/path.h source file, line 130.

this function deletes a node from the file system.

Parameter list:

  • root: Current root directory
  • cwd: Current base directory
  • path: Path of the node to delete, relative (from cwd, or absolute from root). path may contain one or more '/'. It must end with a '\0'

The return value is 0 if node was found and deleted, or an error

See also vfs_node_unlink.

Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:06 2022 using MkDoc