Option to exclude certain extensions when creating CRC checksums?

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
hlloyge
Member
Member
Posts: 131
Joined: 2006-11-02, 23:14 UTC

Option to exclude certain extensions when creating CRC checksums?

Post by *hlloyge »

Hello!

I'd like to have an option to exclude certain filetypes when creating checksums of folders with files. Use case: music with album art. I'd like the possibility to create checksums of only music files, and not album art files. It would be something like adding a bar in scanner options window with excluding filetypes like this:

Excluded: .jpg .png .webp

So everything else inside would be scanned and added in checksum file, except excluded files.
Marc23
Junior Member
Junior Member
Posts: 11
Joined: 2023-03-25, 16:29 UTC

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *Marc23 »

In the meantime, is it possible to link two actions in one button or action ?
Select *.jpg;*.png;*.webp and then Invert Selection
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *beb »

The way I can see workable so far:
1. Configuration - Options - Ignore lists [check] > *.jpg;*.png;*.webp
2. Calculate the checksum for the folders in question (*.jpg;*.png;*.webp won't be included).
I support the separate exclusion option [checkbox, field, and list] for the checksum operations.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *Fla$her »

2hlloyge
You may be interested in such a button:

Code: Select all

TOTALCMD#BAR#DATA
%ComSpec% /q/c for %d in
("%S") do if exist "%%~d\" "%%COMMANDER_PATH%%\Utils\RHash\rhash.exe" "%%~d\*.*" -i -p"%%{sha1} *%%f\n" -o "%%~d\%%~d.sha" --exclude=jpg,png,webp
wcmicons.dll,61
Calculate SHA for selected folders without jpg, png and webp

1
RHash supports many algorithms, but so far without Blake 3. However, on the same algorithms, it is performed much faster than TC.
Overquoting is evil! 👎
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *beb »

Fla$her wrote: 2023-04-30, 15:37 UTC RHash
Interesting tool. Thanks for sharing.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Marc23
Junior Member
Junior Member
Posts: 11
Joined: 2023-03-25, 16:29 UTC

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *Marc23 »

Hi,

Another way: in selection ( Num + ) type:

Code: Select all

* | *.jpg *.png *.webp
Add *. if you want to ignore sub-directory selection

Code: Select all

* | *.jpg *.png *.webp *.
(and save it for next usage)

I've been using TC for 19 years, but I just discovered that we can chain several cm_ commands in one line.
Shame on me :oops: I try some other solutions but I couldn't put this command on a button, even with cm_SpreadSelection or cm_Select :|
(i.e select *.jpg *.png *.webp and then reverse selection does not works)
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *beb »

Marc23 wrote: 2023-05-01, 13:31 UTC ...I couldn't put this command on a button...
It could be done by a different but still similar way (using search instead of selection):

Code: Select all

[searches]
musiccrc_SearchFor=* | *.jpg *.png *.webp
musiccrc_SearchIn=d:\MyMusic
musiccrc_SearchText=
musiccrc_SearchFlags=0|007002010021||||||||22220|0000|||
or in GUI: "Search..." or [Alt+F7] or [Shift+Alt +F7]

Code: Select all

step 1. Search for:* | *.jpg *.png *.webp
step 2. Search in:d:\MyMusic
step 3. "Advanced" tab - "Attributes" [+] {checked} - "Directory" [ ] {unckecked}
step 3. "Load/Save" tab - "Save" button > opt for name "musiccrc" upon saving
usercmd.ini

Code: Select all

[em_test_music_crc]
cmd=loadsearch=musiccrc
button:

Code: Select all

TOTALCMD#BAR#DATA
em_test_music_crc

wciconex.dll
Music_crc_test


10029
Pressing the button a user would get all the files except excluded *.jpg *.png *.webp.
Then the CRC could be calculated as usual.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *Fla$her »

beb wrote: 2023-04-30, 17:02 UTCInteresting tool. Thanks for sharing.
You're welcome. I still have the old button for the selected files:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\Utils\RHash\rhash.exe -i -p"%{sha1} *%f\n"
--file-list="%UL" -o "%B.sha"
wcmicons.dll,61
Calculate SHA for selected files

1
2Marc23, beb
The request concerns files only in the selected directories. The selection of files in the active panel doesn't affect this in any way.
Overquoting is evil! 👎
User avatar
hlloyge
Member
Member
Posts: 131
Joined: 2006-11-02, 23:14 UTC

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *hlloyge »

Fla$her wrote: 2023-04-30, 15:37 UTC 2hlloyge
You may be interested in such a button:

Code: Select all

TOTALCMD#BAR#DATA
%ComSpec% /q/c for %d in
("%S") do if exist "%%~d\" "%%COMMANDER_PATH%%\Utils\RHash\rhash.exe" "%%~d\*.*" -i -p"%%{sha1} *%%f\n" -o "%%~d\%%~d.sha" --exclude=jpg,png,webp
wcmicons.dll,61
Calculate SHA for selected folders without jpg, png and webp

1
RHash supports many algorithms, but so far without Blake 3. However, on the same algorithms, it is performed much faster than TC.
I am so sorry I neglected this thread, to be honest, I forgot abut it.
Your button works, I set it up to make sha256 files, and it's good.
My workflow is to select folder and make sha256 in that folder after calculation. But there is one more thing that TC does, and that's making linux compatible sha256 files, and that's crucial for me, as all my files (and music) is stored on linux-based storage.
Fla$her
Power Member
Power Member
Posts: 2318
Joined: 2020-01-18, 04:03 UTC

Re: Option to exclude certain extensions when creating CRC checksums?

Post by *Fla$her »

2hlloyge
Add --utf8 to the end of the parameters.
The problem will only be in the absence of a BOM signature, i.e. there will be no UTF-8 encoding for names in the ASCII range.
Overquoting is evil! 👎
Post Reply