1
0
Fork 0
mirror of synced 2024-05-08 14:33:31 +12:00
czkawka/czkawka_core/Cargo.toml
Thomas Andreas Jung 03d41e173f
Keep original file if replacing duplicate with hardlink fails (#253)
If the user could not create a hard link (due to permissions or
different block devices) then czkawka lost the duplicate file.

```
$ mkdir hardlink
$ cd hardlink
$ echo a > a
$ cp a b
$ chown thetestuser:thetestuser a
$ ls -il .

25169246 -rw-rw-r-- 1 thetestuser thetestuser 2 Feb  7 11:18 a
25169641 -rw-rw-r-- 1 thomas      thomas      2 Feb  7 11:18 b

$ cargo run --bin czkawka_cli dup --directories $(pwd) -m 1 -f
test101.result --delete-method HARD

[...]
-------------------------------WARNINGS--------------------------------
Failed to link /home/thomas/Development/czkawka/hardlink/b ->
/home/thomas/Development/czkawka/hardlink/a
---------------------------END OF WARNINGS-----------------------------

$ ls -il .
25169246 -rw-rw-r-- 1 thetestuser thetestuser 2 Feb  7 11:18 a
```

Now czkawka keeps all files and the warning provides more information
why czkawka can't replace the duplicate with a hard link.

```
$ cargo run --bin czkawka_cli dup --directories $(pwd) -m 1 -f
test101.result --delete-method HARD

-------------------------------WARNINGS--------------------------------
Failed to link /home/thomas/Development/czkawka/hardlink/b ->
/home/thomas/Development/czkawka/hardlink/a (Operation not permitted (os
error 1))
---------------------------END OF WARNINGS-----------------------------
[...]

25169246 -rw-rw-r-- 1 thetestuser thetestuser 2 Feb  7 11:18 a
25169641 -rw-rw-r-- 1 thomas      thomas      2 Feb  7 11:18 b
```
2021-02-11 19:04:23 +01:00

48 lines
914 B
TOML

[package]
name = "czkawka_core"
version = "2.3.2"
authors = ["Rafał Mikrut <mikrutrafal@protonmail.com>"]
edition = "2018"
description = "Core of Czkawka app"
license = "MIT"
homepage = "https://github.com/qarmin/czkawka"
repository = "https://github.com/qarmin/czkawka"
[dependencies]
humansize = "1"
rayon = "1"
crossbeam-channel = "0.5.0"
# For saving/loading config files to specific directories
directories-next = "2.0.0"
# Needed by similar images
img_hash = "3.1"
bk-tree = "0.3"
image = "0.23.12"
hamming = "0.1"
# Needed by same music
bitflags = "1.2.1"
audiotags = "0.2.7182"
# Futures - needed by async progress sender
futures = "0.3.9"
# Needed by broken files
zip = "0.5.9"
rodio = { version = "0.13.0", optional = true }
# Hashes
blake3 = "0.3"
crc32fast = "1.2.1"
xxhash-rust = { version = "0.8.1", features = ["xxh3"] }
tempfile = "3.1"
[features]
default = []
broken_audio = ["rodio"]