[][src]Crate vfs

Virtual file system abstraction

The virtual file system abstraction generalizes over file systems and allow using different filesystem implementations (i.e. an in memory implementation for unit tests)

A virtual filesystem consists of three basic types

  • Paths - locations in the filesystem
  • File - actual file contents (think inodes)
  • Metadata - metadata information about paths

This crate currently has the following implementations:

  • PhysicalFS - the actual filesystem of the underlying OS
  • MemoryFS - an ephemeral in-memory implementation (intended for unit tests)

Re-exports

pub use physical::PhysicalFS;
pub use altroot::AltrootFS;
pub use memory::MemoryFS;

Modules

altroot

A "physical" file system implementation using the underlying OS file system, with its root in a particular directory. Similar to a chroot but done purely by path manipulation; thus, it's harder to guarentee that it's impossible for a malicious user to escape the given directory.

memory

An ephemeral in-memory file system, intended mainly for unit tests

physical

A "physical" file system implementation using the underlying OS file system

util

Utility functions for working with the virtual file systems

Structs

OpenOptions

Options for opening files

Traits

VFS

An abstract virtual file system

VFile

An abstract file object

VMetadata

File metadata abstraction

VPath

A abstract path to a location in a filesystem

Functions

resolve

Resolve the path relative to the given base returning a new path