Commit Graph

110 Commits (8ea9b4b8001402e77138f80ea9fb16a880dc4c14)

Author SHA1 Message Date
Thomas Andreas Jung 1e94587de8
Ignore duplicates if those are hard links (#234)
This is a proof of concept.

```
$ echo a > hardlinks/a
$ cp hardlinks/{a,b}
$ ln hardlinks/{a,c}
$ cargo run --bin czkawka_cli dup -m 1 --directories $(pwd)/hardlinks -f /dev/stderr > /dev/null
-------------------------------------------------Files with same hashes-------------------------------------------------
Found 1 duplicated files which in 1 groups which takes 2 B.

---- Size 2 B (2) - 2 files
/home/thomas/Development/czkawka/hardlinks/a
/home/thomas/Development/czkawka/hardlinks/b
```

Open:
- Windows support
- Probably this should be a cli option
3 years ago
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
```
3 years ago
Thomas Andreas Jung 3ffa55b008
Add delete method to replace duplicate files with hard links (#236)
This results in the same space saving but keeps the "deleted" files around.

$ mkdir hardlink
$ cd hardlink
$ echo a > a
$ cp a b
$ ln a c
$ touch -t 01010000 a
$ ls -il --time-style=full-iso .
25169323 -rw-rw-r-- 2 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 a
25169558 -rw-rw-r-- 1 thomas thomas 2 2021-01-31 18:11:08.298161098 +0100 b
25169323 -rw-rw-r-- 2 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 c

$ czkawka_cli dup --directories $(pwd)/hardlink -m 1 -f hardlink.result --delete-method HARD

$ ls --time-style=full-iso -li hardlink
25169323 -rw-rw-r-- 3 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 a
25169323 -rw-rw-r-- 3 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 b
25169323 -rw-rw-r-- 3 thomas thomas 2 2021-01-01 00:00:00.000000000 +0100 c
3 years ago
Rafał Mikrut 9f3da0e70f
Add support for CRC32 and XXH3 hash (#243) 3 years ago
Rafał Mikrut 7d8334bb0c
Add template for multiple hashes (#240) 3 years ago
Rafał Mikrut 49ddc041ee
Add about dialog (#226) 3 years ago
Rafał Mikrut e1beaeed28
Decrease ram usage (#212) 3 years ago
Rafał Mikrut 7ec665ab7a
Add cache for duplicate (#205) 3 years ago
Rafał Mikrut 7992ba30de
Fix included/excluded files which contains commas (#195) 3 years ago
Rafał Mikrut 9975605f75
Add buffered write/read (#186) 3 years ago
Rafał Mikrut 3adbfdc5b6
Remove some debug variables (#185) 3 years ago
Rafał Mikrut 7ac4a26229
Add progress bar (#106) 4 years ago
Rafał Mikrut 88d47e49cf
Add select for all modes (#102) 4 years ago
Rafał Mikrut f359905ebc
Add support for multithreading in duplicate finder (#100) 4 years ago
Rafał Mikrut 5d4f4db8c1
Simplify some GUI code (#96) 4 years ago
Rafał Mikrut 7112ff6b92
Add support for checking same file names (#84) 4 years ago
Rafał Mikrut d996c3c46b
Add pre hash check (#83) 4 years ago
Dariusz Niedoba acfecd7ca3
Replace String with PathBuf for paths (#59) 4 years ago
Rafał Mikrut d015b305f2
Add Windows support (#58) 4 years ago
Rafał Mikrut 8bbb12c7d4
Add ability to stop task from GUI (#55) 4 years ago
Caduser2020 085da0369e
Improve code quality. (#52)
* Remove verbose constructs in core.

* Use self and const fn where appropriate.

* Remove needless borrows.

* Fix name in function arguments.

* Merge 'master' into quality

* Decrease function complexity.

* Run fmt.

* Fix clippy.

* Fix duplicate extension files.

* Fix excluded items.

* Fix allowed extensions (Part 2).

* Fix temporary files.
4 years ago
Rafał Mikrut be30afdac6
Add support for searching in other thread (#51) 4 years ago
Rafał Mikrut 1a87a69116 Fixes some typos 4 years ago
Rafał Mikrut 3b63798751 Don't crash when found file name which is not valid Unicode 4 years ago
Rafał Mikrut 8d263fdff2 Minimal file size in duplicate finder should be always greater than 0 4 years ago
Rafał Mikrut a0c99ab14b Don't crash when modified time of file is before unix epoch 4 years ago
Rafał Mikrut 7a1a9ea9f6 Change SystemTime to u64 4 years ago
Rafał Mikrut 2cf5dcd513 Added support for empty file finder 4 years ago
Rafał Mikrut 338352f384 Added checking for duplicates by checking hash of first 1MB of file 4 years ago
Rafał Mikrut 4fb2a0cc92 Smaller code refactoring 4 years ago
Rafał Mikrut 8161a1c59b Big code refactoring 4 years ago
Rafał Mikrut 5f643d4356 Add big files finding to CLI 4 years ago
Rafał Mikrut d17f2d3ef1 Begin of working with finding biggest files 4 years ago
Rafał Mikrut 468c2d7a67 Unified look of enum elements 4 years ago
Rafał Mikrut 343c57f098 Clear a little remove code 4 years ago
Rafał Mikrut 05684a9051 Read more info from GUI fields 4 years ago
Rafał Mikrut 2804af92e5 Remove unused code 4 years ago
Rafał Mikrut b1426d7f95 Added basic printing results in tree_view 4 years ago
Rafał Mikrut 5326024a9b Add support for checking how much data was read by tool[REAL FIX] 4 years ago
Rafał Mikrut 5d10e273a2 Fixed release build printing debug prints 4 years ago
Rafał Mikrut 3d297b3657 Format better file save message 4 years ago
Rafał Mikrut 2b9c0d61df Add saving to empty folders finder, remove exclude directories from it and put warnings to another function 4 years ago
Rafał Mikrut cf127d5c36 Add errors and warnings class 4 years ago
Rafał Mikrut 6b26d4b6fe Use as_str() where possible 4 years ago
Rafał Mikrut 249adfc821 Merge function which finds duplication by size with removing entries which contains only 1 entry 4 years ago
Rafał Mikrut 5caff93a51 Show how much files are in groups 4 years ago
Rafał Mikrut 99b85c73c2 Fixed invalid groups number when saving to file 4 years ago
Rafał Mikrut 4757b28486 Simplify code with duplication and checking 4 years ago
Rafał Mikrut 0f06ed636a Improved searching and printing duplicated entries,
Saving to file
4 years ago
Rafał Mikrut cff5ac93c4 Added support for non recursive search 4 years ago
Rafał Mikrut 4b68330393 Added support for excluded items with wildcard * 4 years ago
Rafał Mikrut a08b4549ba Removed almost all occurrences of println from core 4 years ago
Rafał Mikrut bccc69bd99 Beginning of removing printing text from core. 4 years ago
Rafał Mikrut b19612cfdf Added support for different buttons events for different notebook tabs 4 years ago
Rafał Mikrut feee8c6a83 Add basic search 4 years ago
Rafał Mikrut b71051cda6 Added changelog
Fixed some crashes
4 years ago
Rafał Mikrut bbb13d79ce Fixes some crashes when permissions are denied 4 years ago
Rafał Mikrut 1ccaa91129 Better explanation, starting working with GUI 4 years ago
Rafał Mikrut 7eeff49426 Add some comments 4 years ago
Rafał Mikrut 9d4de08ece Use different modules for library and GUI and CLI apps 4 years ago