Page 1 of 1

Checksum display of a list of files

Posted: 23 Aug 2011 20:30
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.)

Re: Checksum display of a list of files

Posted: 23 Aug 2011 20:38
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;

Re: Checksum display of a list of files

Posted: 23 Aug 2011 23:29
by ramiro9
Thank you very much. That works perfectly, and it was exactly what I was looking for.

Re: Checksum display of a list of files

Posted: 05 Mar 2012 18:00
by grindax
.

Re: Checksum display of a list of files

Posted: 05 Mar 2012 18:14
by avsfan
Are you indenting every line after the first line of the script? That's one of the requirements...

Re: Checksum display of a list of files

Posted: 05 Mar 2012 18:24
by grindax
.

Re: Checksum display of a list of files

Posted: 06 Mar 2012 01:45
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.