Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows hardlinking problem #881

Merged
merged 4 commits into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 101 additions & 111 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion czkawka_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn main() {
set_default_number_of_threads();
println!("Set thread number to {}", get_number_of_threads());
#[cfg(debug_assertions)]
println!("{:?}", command);
println!("{command:?}");

match command {
Commands::Duplicates(duplicates_args) => duplicates(duplicates_args),
Expand Down
10 changes: 5 additions & 5 deletions czkawka_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/qarmin/czkawka"

[dependencies]
humansize = "2.1.2"
rayon = "1.6.0"
rayon = "1.6.1"
crossbeam-channel = "0.5.6"

# For saving/loading config files to specific directories
Expand Down Expand Up @@ -48,9 +48,9 @@ vid_dup_finder_lib = "0.1.1"
ffmpeg_cmdline_utils = "0.1.2"

# Saving/Loading Cache
serde = "1.0.149"
serde = "1.0"
bincode = "1.3.3"
serde_json = "1.0.89"
serde_json = "1.0"

# Language
i18n-embed = { version = "0.13.4", features = ["fluent-system", "desktop-requester"] }
Expand All @@ -66,11 +66,11 @@ imagepipe = "0.5.0"
mime_guess = "2.0.4"
infer = "0.11.0"

num_cpus = "1.14.0"
num_cpus = "1.15.0"

# Heif/Heic
libheif-rs = { version = "0.15.1", optional = true }
anyhow = { version = "1.0.66", optional = true }
anyhow = { version = "1.0", optional = true }

state="0.5.3"

Expand Down
10 changes: 5 additions & 5 deletions czkawka_core/i18n/de/czkawka_core.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Core
core_similarity_original = Ursprünglich
core_similarity_original = Original
core_similarity_very_high = Sehr Hoch
core_similarity_high = Hoch
core_similarity_medium = Mittel
Expand All @@ -10,19 +10,19 @@ core_cannot_open_dir = Verzeichnis { $dir } kann nicht geöffnet werden, Grund {
core_cannot_read_entry_dir = Kann Eintrag in Verzeichnis { $dir } nicht lesen, Grund { $reason }
core_cannot_read_metadata_dir = Metadaten können in Verzeichnis { $dir } nicht gelesen werden, Grund { $reason }
core_file_not_utf8_name = Datei { $name } hat keinen gültigen UTF-8-Namen (einige Zeichen könnten nicht angezeigt werden)
core_file_modified_before_epoch = Datei { $name } scheint vor dem Unix-Epoch geändert worden zu sein
core_folder_modified_before_epoch = Ordner { $name } scheint vor dem Unix-Epoch geändert worden zu sein
core_file_modified_before_epoch = Datei { $name } scheint vor dieser Unix-Epoche geändert worden zu sein
core_folder_modified_before_epoch = Ordner { $name } scheint vor dieser Unix-Epoche geändert worden zu sein
core_file_no_modification_date = Konnte das Änderungsdatum von Datei { $name } nicht abrufen, Grund { $reason }
core_folder_no_modification_date = Konnte das Änderungsdatum aus dem Ordner { $name } nicht abrufen, Grund { $reason }
core_missing_no_chosen_included_directory = Mindestens ein Verzeichnis muss angegeben werden
core_directory_wildcard_no_supported = Verzeichnisse: Wildcards im Pfad werden nicht unterstützt, { $path } wird ignoriert
core_directory_relative_path = Verzeichnisse: Relativer Pfad wird nicht unterstützt, { $path } wird ignoriert
core_directory_must_exists = Verzeichnisse: Der angegebene Ordnerpfad muss existieren, { $path } wird ignoriert
core_directory_must_be_directory = Verzeichnisse: Der angegebene Pfad muss auf das Verzeichnis zeigen, { $path } wird ignoriert
core_included_directory_zero_valid_directories = Inklusive Verzeichnis-FEHLER: Nicht einmal einen korrekten Pfad zu inkludiert, der erforderlich ist
core_included_directory_zero_valid_directories = Einbezogenes Verzeichnis-FEHLER: Kein korrekter Pfad gefunden, welcher einbezogen werden soll, was erforderlich ist
core_excluded_directory_pointless_slash = Verzeichnisse: / auszuschließen ist sinnlos, weil somit keine Dateien gescannt werden
core_directory_overlap = Verzeichnisse: Alle zu durchsuchende Verzeichnisse überlappen mit den ausgeschlossenen Verzeichnissen
core_directory_unable_to_get_device_id = Verzeichnisse: Geräte-Id kann nicht aus dem Ordner { $path } geholt werden
core_directory_unable_to_get_device_id = Verzeichnisse: Geräte-ID kann nicht aus dem Ordner { $path } geholt werden
core_ffmpeg_not_found = Keine richtige Installation von FFmpeg gefunden
core_ffmpeg_not_found_windows = Stellen Sie sicher, dass ffmpeg.exe und ffprobe.exe in PATH verfügbar sind oder direkt in den gleichen Ordner gelegt werden, in dem die App ausführbar ist
core_ffmpeg_missing_in_snap = Ähnliche Videos funktionieren derzeit nicht mit Snap, wenn du Hilfe möchtest, besuche - { $url }
Expand Down
12 changes: 6 additions & 6 deletions czkawka_core/i18n/ko/czkawka_core.ftl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Core
core_similarity_original = 원본
core_similarity_very_high = 유사도 매우 높음
core_similarity_high = 유사도 높음
core_similarity_medium = 유사도 보통
core_similarity_small = 유사도 적음
core_similarity_very_small = 유사도 매우 적음
core_similarity_minimal = 유사도 거의 없음
core_similarity_very_high = 매우 높음
core_similarity_high = 높음
core_similarity_medium = 보통
core_similarity_small = 낮음
core_similarity_very_small = 매우 낮음
core_similarity_minimal = 최소
core_cannot_open_dir = { $dir } 디렉터리를 열 수 없습니다. 이유: { $reason }
core_cannot_read_entry_dir = { $dir } 디렉터리를 열 수 없습니다. 이유: { $reason }
core_cannot_read_metadata_dir = { $dir } 디렉터리의 메타데이터를 열 수 없습니다. 이유: { $reason }
Expand Down
2 changes: 1 addition & 1 deletion czkawka_core/i18n/pl/czkawka_core.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ core_similarity_minimal = Minimalne
core_cannot_open_dir = Nie można otworzyć folderu { $dir }, powód { $reason }
core_cannot_read_entry_dir = Nie można odczytać danych z folderu { $dir }, powód { $reason }
core_cannot_read_metadata_dir = Nie można odczytać metadanych folderu { $dir }, powód { $reason }
core_file_not_utf8_name = Plik { $name } nie posiada nazwy zakodowanej za pomocą UTF-8 (niektóre znaki mogą się nie wyświetlać)
core_file_not_utf8_name = Plik { $name } nie posiada nazwy zakodowanej za pomocą UTF-8(niektóre znaki mogą się nie wyświetlać)
core_file_modified_before_epoch = Plik { $name } ma datę modyfikacji sprzed epoki unixa
core_folder_modified_before_epoch = Folder { $name } ma datę modyfikacji sprzed epoki unixa
core_file_no_modification_date = Nie udało się pobrać daty modyfikacji z pliku { $name }, powód { $reason }
Expand Down
2 changes: 1 addition & 1 deletion czkawka_core/i18n/ru/czkawka_core.ftl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Core
core_similarity_original = Оригинал
core_similarity_original = Оригинальное
core_similarity_very_high = Очень высокое
core_similarity_high = Высокое
core_similarity_medium = Среднее
Expand Down
54 changes: 27 additions & 27 deletions czkawka_core/i18n/tr/czkawka_core.ftl
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Core
core_similarity_original = Orijinal
core_similarity_original = Asıl
core_similarity_very_high = Çok Yüksek
core_similarity_high = Akşam vakti
core_similarity_high = Yüksek
core_similarity_medium = Orta
core_similarity_small = Küçük
core_similarity_very_small = Çok Küçük
core_similarity_minimal = En az
core_cannot_open_dir = Cannot open dir { $dir }, reason { $reason }
core_cannot_read_entry_dir = Cannot read entry in dir { $dir }, reason { $reason }
core_cannot_read_metadata_dir = Cannot read metadata in dir { $dir }, reason { $reason }
core_file_not_utf8_name = File { $name } does not have a valid UTF-8 name (some characters may not be shown)
core_file_modified_before_epoch = File { $name } seems to be modified before Unix Epoch
core_folder_modified_before_epoch = Folder { $name } seems to be modified before Unix Epoch
core_file_no_modification_date = Unable to get modification date from file { $name }, reason { $reason }
core_folder_no_modification_date = Unable to get modification date from folder { $name }, reason { $reason }
core_missing_no_chosen_included_directory = At least one directory must be provided
core_directory_wildcard_no_supported = Directories: Wildcards in path are not supported, ignoring { $path }
core_directory_relative_path = Directories: Relative path are not supported, ignoring { $path }
core_directory_must_exists = Directories: Provided folder path must exist, ignoring { $path }
core_directory_must_be_directory = Directories: Provided path must point at the directory, ignoring { $path }
core_included_directory_zero_valid_directories = Included Directory ERROR: Not found even one correct path to included which is required
core_excluded_directory_pointless_slash = Directories: Excluding / is pointless, because it means that no files will be scanned
core_directory_overlap = Directories: All directories to search overlaps with excluded directories
core_directory_unable_to_get_device_id = Directories: Unable to get device id from folder { $path }
core_ffmpeg_not_found = Cannot find proper installation of FFmpeg
core_ffmpeg_not_found_windows = Be sure that ffmpeg.exe and ffprobe.exe are available in PATH or are put directly to same folder where is app executable
core_ffmpeg_missing_in_snap = Similar Videos don't work currently with snap, if you want help look at - { $url }
core_saving_to_cache = Saved to file { $number } cache entries
core_loading_from_cache = Loaded from cache { $number } entries
core_similarity_small = Düşük
core_similarity_very_small = Çok Düşük
core_similarity_minimal = Aşırı Düşük
core_cannot_open_dir = { $dir } dizini açılamıyor, nedeni: { $reason }
core_cannot_read_entry_dir = { $dir } dizinindeki girdi okunamıyor, nedeni: { $reason }
core_cannot_read_metadata_dir = { $dir } dizinindeki metaveri okunamıyor, nedei: { $reason }
core_file_not_utf8_name = { $name } dosyasının geçerli bir UTF-8 adı yok (kimi karakterler gösterilemeyebilir)
core_file_modified_before_epoch = { $name } dosyası Unix Epoch'tan önce değiştirilmiş gibi görünüyor.
core_folder_modified_before_epoch = { $name } klasörü Unix Epoch'tan önce değiştirilmiş gibi görünüyor.
core_file_no_modification_date = { $name } dosyasının değişiklik tarihine erişilemiyor, nedeni: { $reason }
core_folder_no_modification_date = { $name } klasörünün değişiklik tarihine erişilemiyor, nedeni: { $reason }
core_missing_no_chosen_included_directory = "Aranacak Dizinler" listesinde en az bir dizin yer almalıdır.
core_directory_wildcard_no_supported = Dizinler: Yol adında joker karakterler desteklenmez, { $path } yok sayıldı.
core_directory_relative_path = Dizinler: Göreli yol desteklenmez, { $path } yok sayıldı.
core_directory_must_exists = Dizinler: Girilen klasör yolu var olmalı, { $path } yok sayıldı.
core_directory_must_be_directory = Dizinler: Girilen yol bir dizini göstermelidir, { $path } yok sayıldı.
core_included_directory_zero_valid_directories = "Aranacak Dizinler" listesinde HATA: Tarama yapılması için gerekli olan tek bir doğru yol bile bulunamadı.
core_excluded_directory_pointless_slash = Dizinler: "/" kök dizinini hariç tutmak anlamsızdır, çünkü bu hiçbir dosyanın taranmayacağı anlamına gelir.
core_directory_overlap = Dizinler: Aranacak tüm dizinler, hariç tutulan dizinlerle çakışıyor.
core_directory_unable_to_get_device_id = Dizinler: { $path } klasörünün aygıt kimliği bilgisine erişilemiyor.
core_ffmpeg_not_found = FFmpeg'in uygun kurulumu bulunamıyor.
core_ffmpeg_not_found_windows = "ffmpeg(.exe)" ve "ffprobe(.exe)" uygulamalarının PATH dizininde ya da uygulamanın doğrudan yürütüldüğü dizinde yer aldığından ve 'yürütülebilir' olarak işaretlendiğinden emin olun.
core_ffmpeg_missing_in_snap = Benzer Videolar şu anda snap ile çalışmıyor, eğer yardım istiyorsanız - { $url }
core_saving_to_cache = { $number } adet SUÇ kaydı önbellek dosyasına yazıldı. ;-)
core_loading_from_cache = Önbellek dosyasından { $number } adet SUÇ kaydı okundu. ;-)
6 changes: 3 additions & 3 deletions czkawka_core/src/bad_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl BadExtensions {
}
}

let mut guessed_multiple_extensions = format!("({}) - ", proper_extension);
let mut guessed_multiple_extensions = format!("({proper_extension}) - ");
for ext in &all_available_extensions {
guessed_multiple_extensions.push_str(ext);
guessed_multiple_extensions.push(',');
Expand Down Expand Up @@ -523,7 +523,7 @@ impl SaveResults for BadExtensions {
let file_handler = match File::create(&file_name) {
Ok(t) => t,
Err(e) => {
self.text_messages.errors.push(format!("Failed to create file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to create file {file_name}, reason {e}"));
return false;
}
};
Expand All @@ -534,7 +534,7 @@ impl SaveResults for BadExtensions {
"Results of searching {:?} with excluded directories {:?} and excluded items {:?}",
self.directories.included_directories, self.directories.excluded_directories, self.excluded_items.items
) {
self.text_messages.errors.push(format!("Failed to save results to file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to save results to file {file_name}, reason {e}"));
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions czkawka_core/src/big_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl SaveResults for BigFile {
let file_handler = match File::create(&file_name) {
Ok(t) => t,
Err(e) => {
self.text_messages.errors.push(format!("Failed to create file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to create file {file_name}, reason {e}"));
return false;
}
};
Expand All @@ -460,7 +460,7 @@ impl SaveResults for BigFile {
"Results of searching {:?} with excluded directories {:?} and excluded items {:?}",
self.directories.included_directories, self.directories.excluded_directories, self.excluded_items.items
) {
self.text_messages.errors.push(format!("Failed to save results to file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to save results to file {file_name}, reason {e}"));
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions czkawka_core/src/broken_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ impl SaveResults for BrokenFiles {
let file_handler = match File::create(&file_name) {
Ok(t) => t,
Err(e) => {
self.text_messages.errors.push(format!("Failed to create file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to create file {file_name}, reason {e}"));
return false;
}
};
Expand All @@ -674,7 +674,7 @@ impl SaveResults for BrokenFiles {
"Results of searching {:?} with excluded directories {:?} and excluded items {:?}",
self.directories.included_directories, self.directories.excluded_directories, self.excluded_items.items
) {
self.text_messages.errors.push(format!("Failed to save results to file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to save results to file {file_name}, reason {e}"));
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions czkawka_core/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ impl Common {
path = Path::new(entry);
if path.is_dir() {
if let Err(e) = fs::remove_dir_all(entry) {
warnings.push(format!("Failed to remove folder {}, reason {}", entry, e));
warnings.push(format!("Failed to remove folder {entry}, reason {e}"));
}
} else if let Err(e) = fs::remove_file(entry) {
warnings.push(format!("Failed to remove file {}, reason {}", entry, e));
warnings.push(format!("Failed to remove file {entry}, reason {e}"));
}
}
warnings
Expand All @@ -225,10 +225,10 @@ impl Common {
let mut warning: String = String::from("");
if path.is_dir() {
if let Err(e) = fs::remove_dir_all(entry) {
warning = format!("Failed to remove folder {}, reason {}", entry, e)
warning = format!("Failed to remove folder {entry}, reason {e}")
}
} else if let Err(e) = fs::remove_file(entry) {
warning = format!("Failed to remove file {}, reason {}", entry, e)
warning = format!("Failed to remove file {entry}, reason {e}")
}
warning
}
Expand Down
6 changes: 3 additions & 3 deletions czkawka_core/src/common_extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ impl Extensions {
}

if !extension.starts_with('.') {
extension = format!(".{}", extension);
extension = format!(".{extension}");
}

if extension[1..].contains('.') {
text_messages.warnings.push(format!("{} is not valid extension because contains dot inside", extension));
text_messages.warnings.push(format!("{extension} is not valid extension because contains dot inside"));
continue;
}

if extension[1..].contains(' ') {
text_messages
.warnings
.push(format!("{} is not valid extension because contains empty space inside", extension));
.push(format!("{extension} is not valid extension because contains empty space inside"));
continue;
}

Expand Down
10 changes: 5 additions & 5 deletions czkawka_core/src/duplicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ impl SaveResults for DuplicateFinder {
let file_handler = match File::create(&file_name) {
Ok(t) => t,
Err(e) => {
self.text_messages.errors.push(format!("Failed to create file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to create file {file_name}, reason {e}"));
return false;
}
};
Expand All @@ -1014,7 +1014,7 @@ impl SaveResults for DuplicateFinder {
"Results of searching {:?} with excluded directories {:?} and excluded items {:?}",
self.directories.included_directories, self.directories.excluded_directories, self.excluded_items.items
) {
self.text_messages.errors.push(format!("Failed to save results to file {}, reason {}", file_name, e));
self.text_messages.errors.push(format!("Failed to save results to file {file_name}, reason {e}"));
return false;
}
match self.check_method {
Expand Down Expand Up @@ -1117,7 +1117,7 @@ impl PrintResults for DuplicateFinder {
number_of_files += i.1.len() as u64;
number_of_groups += 1;
}
println!("Found {} files in {} groups with same name(may have different content)", number_of_files, number_of_groups,);
println!("Found {number_of_files} files in {number_of_groups} groups with same name(may have different content)",);
for (name, vector) in &self.files_with_identical_names {
println!("Name - {} - {} files ", name, vector.len());
for j in vector {
Expand Down Expand Up @@ -1282,7 +1282,7 @@ pub fn save_hashes_to_file(hashmap: &BTreeMap<String, FileEntry>, text_messages:
if file_entry.size >= minimal_cache_file_size {
let string: String = format!("{}//{}//{}//{}", file_entry.path.display(), file_entry.size, file_entry.modified_date, file_entry.hash);

if let Err(e) = writeln!(writer, "{}", string) {
if let Err(e) = writeln!(writer, "{string}") {
text_messages
.warnings
.push(format!("Failed to save some data to cache file {}, reason {}", cache_file.display(), e));
Expand Down Expand Up @@ -1411,7 +1411,7 @@ fn hash_calculation(buffer: &mut [u8], file_entry: &FileEntry, hash_type: &HashT

fn get_file_hash_name(type_of_hash: &HashType, is_prehash: bool) -> String {
let prehash_str = if is_prehash { "_prehash" } else { "" };
format!("cache_duplicates_{:?}{}.txt", type_of_hash, prehash_str)
format!("cache_duplicates_{type_of_hash:?}{prehash_str}.txt")
}

impl MyHasher for blake3::Hasher {
Expand Down
Loading