1
0
Fork 0
mirror of synced 2024-05-03 20:14:00 +12:00

Always remove files created to check if hardlinking works (#883)

This commit is contained in:
Rafał Mikrut 2022-12-22 19:59:50 +01:00 committed by GitHub
parent c9e9a65cc9
commit 8e24492416
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -814,7 +814,7 @@ fn get_cache_file() -> String {
}
pub fn check_if_ffmpeg_is_installed() -> bool {
let vid = "999999999999999999.txt";
let vid = "9999czekoczekoczekolada999.txt";
if let Err(DetermineVideo {
src_path: _a,
error: FfmpegNotFound,

View file

@ -135,6 +135,8 @@ fn test_hardlinks() -> bool {
use std::io::Write;
use std::path::Path;
let mut hardlinked = false;
if let Some(proj_dirs) = ProjectDirs::from("pl", "Qarmin", "Czkawka") {
let cache_dir = proj_dirs.cache_dir();
let cache_file = cache_dir.join(Path::new("GILLES_FROM_NOSE.temp"));
@ -153,12 +155,12 @@ fn test_hardlinks() -> bool {
let _ = fs::hard_link(&cache_file, &cache_file_second);
if cache_file.exists() && cache_file_second.exists() {
return true;
hardlinked = true;
}
}
let _ = fs::remove_file(&cache_file);
let _ = fs::remove_file(&cache_file_second);
}
false
hardlinked
}