Crate ext2

Source
Expand description

This crate was created with the purpose of being able to read and write on ext2 partitions, whether they are in block device or in the form of a simple disk image file.

It does not require any Unix kernel module to function. Originally, it was designed to open ext2 images from within a Docker container without the need for privileged mode.

This crate covers basic system calls:

  • open : Open a file.
  • read_dir : Returns a Vector over the entries within a directory.
  • create_dir : Creates a new, empty directory at the provided path.
  • remove_dir : Removes an empty directory.
  • chmod : Change the file permission bits of the specified file.
  • chown : Change the ownership of the file at path to be owned by the specified owner (user) and group.
  • stat : This function returns information about a file.
  • remove_file : Removes a file from the filesystem.
  • utime : Change the access and modification times of a file.
  • rename : Rename a file or directory to a new name, it cannot replace the original file if to already exists.
  • link : Make a new name for a file. It is also called “hard-link”.
  • symlink : Make a new name for a file. It is symbolic links.

Additionally, the crate also has its own implementation of OpenOptions.

You have full permissions on the files, and all specified paths must be absolute. Currently, this crate only works on Unix-like operating systems.

Disclaimer : This crate is still in its early stages and should be used with caution on existing system partitions.

this module contains a ext2 driver see osdev

FUTURE ROAD MAP

  • Fix some incoherencies
  • Use std::io::Error instead of IOError
  • Use ErrorKind instead of errno
  • Made compilation on others platforms than UNIX
  • no-std
  • Cache of directory entries
  • Change current directory
  • Set Permissions

Structs§

Ext2
This structure represents an entire ext2 filesystem.
File
An object providing access to an open file on the EXT2 filesystem.
OpenOptions
Options and flags which can be used to configure how a file is opened.

Functions§

open_ext2_drive
Invocation of a new FileSystem instance: Take anything that implements Read + Seek + Write.