Don't ask to ask, just ask | |
PerlMonks |
Re: MD5 checksums for Windowsby Anonymous Monk |
on Jan 13, 2015 at 21:02 UTC ( [id://1113149]=note: print w/replies, xml ) | Need Help?? |
Thanks for sharing! Just an observation, which may not be relevant, since your script's output format doesn't exactly match that of md5sum (you include the file's size): md5sum offers a -b switch, which mainly adds the "b" to the fopen call, which "has no effect; the 'b' is ignored on all POSIX conforming systems, including Linux." It also adds an asterisk to the output line to indicate that the binary mode was used, like so:
But in my experience people usually ignore the -b switch because it has no effect on those systems. On Windows, of course it's a different story, since there, fopen cares about the "b" mode (among other things, "translations involving carriage-return and linefeed characters are suppressed"). Now whether or not this is an issue at all depends on whether there's a Windows MD5 checksumming tool that defaulted to reading files in text mode. But since you're on Windows and you use binmode, if you felt like making your output more similar to that of md5sum, you could consider adding the asterisk to your output.
In Section
Cool Uses for Perl
|
|