Crate ext4 [] [src]

This crate can load ext4 filesystems, letting you read metadata and files from them.

Example

let mut block_device = std::io::BufReader::new(std::fs::File::open("/dev/sda1").unwrap());
let mut superblock = ext4::SuperBlock::new(&mut block_device).unwrap();
let target_inode_number = superblock.resolve_path("/etc/passwd").unwrap().inode;
let inode = superblock.load_inode(target_inode_number).unwrap();
let passwd_reader = superblock.open(&inode).unwrap();

Note: normal users can't read /dev/sda1 by default, as it would allow them to read any file on the filesystem. You can grant yourself temporary access with sudo setfacl -m u:${USER}:r /dev/sda1, if you so fancy. This will be lost at reboot.

Modules

parse

Raw object parsing API. Not versioned / supported.

Structs

DirEntry

An entry in a directory, without its extra metadata.

Error

The Error type.

Inode

An actual disc metadata entry.

InodeFlags
Options
Stat

Full information about a disc entry.

SuperBlock

The critical core of the filesystem.

Time

A raw filesystem time.

Enums

Checksums
Enhanced

Extended, type-specific information read from an inode.

ErrorKind

The kind of an error.

FileType

Flag indicating the type of file stored in this inode.

Constants

INODE_APPEND
INODE_COMPR
INODE_COMPRBLK
INODE_DIRSYNC
INODE_DIRTY
INODE_EA_INODE
INODE_ENCRYPT
INODE_EOFBLOCKS
INODE_EXTENTS
INODE_HUGE_FILE
INODE_IMAGIC
INODE_IMMUTABLE
INODE_INDEX
INODE_INLINE_DATA
INODE_JOURNAL_DATA
INODE_NOATIME
INODE_NOCOMPR
INODE_NODUMP
INODE_NOTAIL
INODE_PROJINHERIT
INODE_RESERVED
INODE_SECRM
INODE_SYNC
INODE_TOPDIR
INODE_UNRM

Traits

ResultExt

Additional methods for Result, for easy interaction with this crate.

Functions

usize_check

Type Definitions

Result

Convenient wrapper around std::Result.