finished. got it properly working on linux
This commit is contained in:
parent
7fc4e37a30
commit
60fc4fa5c3
1 changed files with 2 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::fs::{File, DirEntry};
|
use std::fs::DirEntry;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::num::ParseIntError;
|
use std::num::ParseIntError;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
@ -115,11 +115,7 @@ fn traverse_filesystem(path: &Path) -> (Vec<String>, Vec<String>){
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_permissions(path: &str, mode: u32) -> Result<(), std::io::Error> {
|
fn set_permissions(path: &str, mode: u32) -> Result<(), std::io::Error> {
|
||||||
let file = File::create(path)?;
|
fs::set_permissions(path, fs::Permissions::from_mode(mode))?;
|
||||||
let metadata = file.metadata()?;
|
|
||||||
let mut permissions = metadata.permissions();
|
|
||||||
|
|
||||||
permissions.set_mode(mode);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue