Checksum display of a list of files

Discuss and share scripts and script files...
Post Reply
ramiro9
Posts: 4
Joined: 23 Aug 2011 20:18

Checksum display of a list of files

Post by ramiro9 »

I'm looking for a way to display the checksum of a selected group of files. Sometimes I have a bunch of files with different names, but identical content.

This sort of works:

foreach($file, <get selecteditemspathnames |>) {
text hash("crc32",$file,1);
}

but awkwardly; it pops up a message box for each file. I'd like to see the checksums for all the files at once, ideally next to the file name.

(I miss having that option in another file manager, it was an optional column you could display in the file list. Too bad x******2 was a buggy POS for me.)

highend
Posts: 14940
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Checksum display of a list of files

Post by highend »

Code: Select all

	$result = "";
	foreach($file, <get selecteditemspathnames |>) {
		if($file == "") { break; }
		$checksum = hash("crc32",$file,1);
		$result = $result . $file . " Checksum: " . $checksum . <crlf>;
	}
	text $result;
One of my scripts helped you out? Please donate via Paypal

ramiro9
Posts: 4
Joined: 23 Aug 2011 20:18

Re: Checksum display of a list of files

Post by ramiro9 »

Thank you very much. That works perfectly, and it was exactly what I was looking for.

grindax

Re: Checksum display of a list of files

Post by grindax »

.
Last edited by grindax on 22 Jan 2016 22:43, edited 2 times in total.

avsfan
Posts: 554
Joined: 29 Jun 2006 09:00
Location: Fort Collins, Colorado

Re: Checksum display of a list of files

Post by avsfan »

Are you indenting every line after the first line of the script? That's one of the requirements...

grindax

Re: Checksum display of a list of files

Post by grindax »

.
Last edited by grindax on 22 Jan 2016 22:43, edited 1 time in total.

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Checksum display of a list of files

Post by PeterH »

The necessary indentation for XY is that *every* script line not being a label must be indented at least by one space character. All other indentation is only for readability, for example to "read" loops etc.

All non-indented lines are interpreted as labels.

Post Reply