libext2fs: File handle manipulation

 
 2.2.1 File handle manipulation
 ------------------------------
 
 The file handle functions much like a file descriptor in the Linux/POSIX
 file I/O system calls.  Unlike the Linux/POSIX system calls, files are
 opened via inode numbers instead of via pathnames.  To resolve a
 pathname to an inode number, use the function 'ext2fs_namei' or to
 create a new file, use 'ext2fs_new_inode' and 'ext2fs_link'.
 
  -- Function: errcode_t ext2fs_file_open2 (ext2_filsys FS, ext2_ino_t
           INO, struct ext2_inode *INODE, int FLAGS, ext2_file_t *RET)
  -- Function: errcode_t ext2fs_file_open (ext2_filsys FS, ext2_ino_t
           INO, int FLAGS, ext2_file_t *RET)
 
      Opens a file identified by inode number INO in filesystem FS and
      returns a file handle in RET.  If an inode structure is provided in
      INODE, then it is used instead of reading the inode from the
      filesystem.
 
      The FLAGS argument contains a bitmask of flags which control how
      the file should be opened.
 
      'EXT2_FILE_WRITE'
           Open the file for reading and writing.  Without this flag, the
           file is opened for writing only.
 
      'EXT2_FILE_CREATE'
           Create the file if it is not already present.
 
  -- Function: ext2_filsys ext2fs_file_get_fs (ext2_file_t FILE)
      Return the filesystem handle where the open file FILE was opened.
 
  -- Function: errcode_t ext2fs_file_close (ext2_file_t FILE)
      Close the file handle FILE.
 
  -- Function: errcode_t ext2fs_file_flush (ext2_file_t FILE)
      Force any data written via 'ext2fs_file_write' to disk.