remove log files
This commit is contained in:
18
src/main.rs
18
src/main.rs
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user