Skip to content

Commit

Permalink
APFS filesystem support (closes #171)
Browse files Browse the repository at this point in the history
  • Loading branch information
svartalf committed Sep 23, 2019
1 parent 30fe011 commit b56e57c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion heim-disk/examples/partitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async fn main() -> Result<()> {

println!("---- Physical partitions ----");

let mut partitions = disk::partitions();
let mut partitions = disk::partitions_physical();
while let Some(part) = partitions.next().await {
dbg!(part?);
}
Expand Down
5 changes: 5 additions & 0 deletions heim-disk/src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ pub enum FileSystem {
/// XFS (https://en.wikipedia.org/wiki/XFS)
Xfs,

/// APFS (https://en.wikipedia.org/wiki/Apple_File_System)
Apfs,

// TODO: Should it be considered as a physical FS?
/// FUSE (https://en.wikipedia.org/wiki/Filesystem_in_Userspace)
FuseBlk,
Expand Down Expand Up @@ -106,6 +109,7 @@ impl FileSystem {
FileSystem::Minix => "minix",
FileSystem::Nilfs => "nilfs",
FileSystem::Xfs => "xfs",
FileSystem::Apfs => "apfs",
FileSystem::Other(string) => string.as_str(),
_ => unimplemented!(),
}
Expand Down Expand Up @@ -134,6 +138,7 @@ impl FromStr for FileSystem {
_ if s.eq_ignore_ascii_case("minix") => Ok(FileSystem::Minix),
_ if s.eq_ignore_ascii_case("nilfs") => Ok(FileSystem::Nilfs),
_ if s.eq_ignore_ascii_case("xfs") => Ok(FileSystem::Xfs),
_ if s.eq_ignore_ascii_case("apfs") => Ok(FileSystem::Apfs),

_ if s.eq_ignore_ascii_case("fuseblk") => Ok(FileSystem::FuseBlk),
_ => Ok(FileSystem::Other(s.to_string())),
Expand Down

0 comments on commit b56e57c

Please sign in to comment.