-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: provide
os_limited::metadata()
.
Metadata is currently limited to the amount of things, like bytes or entries, in the metadata item, but there is potential for adding more later.
- Loading branch information
Showing
5 changed files
with
154 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#[cfg(not(any( | ||
target_os = "windows", | ||
all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")) | ||
)))] | ||
fn main() { | ||
println!("This is currently only supported on Windows, Linux, and other Freedesktop.org compliant OSes"); | ||
} | ||
|
||
#[cfg(any( | ||
target_os = "windows", | ||
all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")) | ||
))] | ||
fn main() { | ||
let trash_items = trash::os_limited::list().unwrap(); | ||
|
||
for item in trash_items { | ||
let metadata = trash::os_limited::metadata(&item).unwrap(); | ||
println!("{:?}: {:?}", item, metadata); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters