Diplaying xattrs (re #1)

This commit is contained in:
Dennis Schwerdel 2017-04-13 15:08:21 +02:00
parent f7899bb9f3
commit 3cb21cb59e
1 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,7 @@ use std::collections::HashMap;
use std::io::{BufReader, BufRead};
use std::fs::File;
use std::env;
use std::str;
use std::path::Path;
use self::args::Arguments;
@ -175,6 +176,16 @@ fn print_inode(inode: &Inode) {
println!(" - {}", name);
}
}
if !inode.xattrs.is_empty() {
println!("Extended attributes:");
for (key, value) in &inode.xattrs {
if let Ok(value) = str::from_utf8(value) {
println!(" - {} = '{}'", key, value);
} else {
println!(" - {} = 0x{}", key, to_hex(value));
}
}
}
}
fn print_backups(backup_map: &HashMap<String, Backup>) {