remove log files

This commit is contained in:
2024-11-11 18:43:33 +01:00
parent 3a51e92518
commit e5a7906cdf
3 changed files with 11 additions and 111 deletions

View File

@ -41,8 +41,8 @@ fn generate_file(website_name: &str) {
fn convert_folders(root_folder: &str) {
let mut client = Client::connect("host=192.168.0.10 port=28945 user=hentai password=h99nqaNPhpfbuuhCDwQXLpZAnoVTjSQP7taoqmQhpzc2rPLVC4JUAKxAHfuuhuU9", NoTls).unwrap();
let filename: &str = "convert_folder.log";
let mut file = match File::create(filename) {
let filename: &str = "convert_folders.log";
let mut log_file = match File::create(filename) {
Ok(file) => file,
Err(error) => {
let message = error.to_string();
@ -70,28 +70,28 @@ fn convert_folders(root_folder: &str) {
}
fs::rename(&old_path, &new_path).unwrap();
writeln!(file, "Converted {} => {}", old_path, new_path).unwrap();
writeln!(log_file, "Converted {} => {}", old_path, new_path).unwrap();
}
}
fn import_file(filename: &str) {
let file = File::open(filename).unwrap();
let reader_iter = BufReader::new(file).lines();
let input_file = File::open(filename).unwrap();
let reader_iter = BufReader::new(input_file).lines();
let mut client = Client::connect("host=192.168.0.10 port=28945 user=hentai password=h99nqaNPhpfbuuhCDwQXLpZAnoVTjSQP7taoqmQhpzc2rPLVC4JUAKxAHfuuhuU9", NoTls).unwrap();
let mut other_file = match File::create("Fucked.txt") {
let mut fucked_file = match File::create("Fucked.txt") {
Ok(file) => file,
Err(error) => {
let message = error.to_string();
panic!("Problem opening the file: {message}");
}
};
writeln!(other_file, "Them are hella fucked").unwrap();
writeln!(fucked_file, "Them are hella fucked").unwrap();
for line in reader_iter {
let line = line.unwrap();
if line.contains("#") {
writeln!(other_file, "{}", line).unwrap();
writeln!(fucked_file, "{}", line).unwrap();
continue;
}
@ -99,7 +99,7 @@ fn import_file(filename: &str) {
let result: i32 = output.get(0);
if result == 1 {
writeln!(other_file, "{}", line).unwrap();
writeln!(fucked_file, "{}", line).unwrap();
}
}
}