Re: sha-2 sum of files?

2013-06-12 Thread David Christensen
On 06/12/13 02:28, lee wrote: Yes, I've been looking at descriptions like that and I don't know perl well enough to understand them. ... This is why I was looking for an example so I can see how these things are being used. Does this make sense? 2013-06-12 15:51:48 dpchrist@desktop ~/sandbox

Re: SOLVED: sha-2 sum of files?

2013-06-12 Thread Shlomi Fish
Hi Lee, thanks for replying to the list and for not top posting. See below for my comments. On Wed, 12 Jun 2013 17:50:57 +0200 lee wrote: > Shlomi Fish writes: > > > Hi Lee, > > > > some comments on your code: > > > > On Wed, 12 Jun 2013 11:28:34 +0200 > > lee wrote: > > > >> David Christen

Re: sha-2 sum of files?

2013-06-12 Thread lee
Shlomi Fish writes: >> I've been googling for examples of how to create a sha-2 sum of a file >> in perl without success. What I'm looking for is something like: > > In general, you should not Google for Perl information, because Google tends > to > find outdated results. Instead, use MetaCPAN

SOLVED: sha-2 sum of files?

2013-06-12 Thread lee
Shlomi Fish writes: > Hi Lee, > > some comments on your code: > > On Wed, 12 Jun 2013 11:28:34 +0200 > lee wrote: > >> David Christensen writes: >> >> > On 06/11/13 21:44, lee wrote: >> >> ... what I don't understand is what >> >> the most efficient way would be to create a sha-2 sum for a fil

Re: sha-2 sum of files?

2013-06-12 Thread lee
James Alton writes: > What is the reason for checking file hashes once a month? Are you just > trying to do a basic sys admin task like ensuring system file integrity? No > sense in reinventing the wheel. Look into tripwire. > http://www.linuxjournal.com/article/8758 The purpose is to generate m

Re: sha-2 sum of files?

2013-06-12 Thread Jim Gibson
On Jun 12, 2013, at 2:33 AM, lee wrote: > Jim Gibson writes: > >> >> The first thing to do would be to check the file size. If the file >> size has changed, then the file has been modified. So you will want to >> save the file size. > > The file might be modified without changing its size ...

Re: sha-2 sum of files?

2013-06-12 Thread James Alton
What is the reason for checking file hashes once a month? Are you just trying to do a basic sys admin task like ensuring system file integrity? No sense in reinventing the wheel. Look into tripwire. http://www.linuxjournal.com/article/8758 Cheers, James On Wed, Jun 12, 2013 at 2:27 AM, lee wrot

Re: sha-2 sum of files?

2013-06-12 Thread Shlomi Fish
Hi Lee, some comments on your code: On Wed, 12 Jun 2013 11:28:34 +0200 lee wrote: > David Christensen writes: > > > On 06/11/13 21:44, lee wrote: > >> ... what I don't understand is what > >> the most efficient way would be to create a sha-2 sum for a file. > > > > Have you considered Digest?

Re: sha-2 sum of files?

2013-06-12 Thread lee
Pritish Pattanaik writes: > Hello Lee, > > use Digest::MD5 module I believe solve your problem, But you can > incorporate other Perl modules to achieve your task. > > Things I would consider for this task : > > 1. Scripts checks on file/directory on every ? seconds once a month > 2. I should no

Re: sha-2 sum of files?

2013-06-12 Thread lee
David Christensen writes: > On 06/11/13 21:44, lee wrote: >> ... what I don't understand is what >> the most efficient way would be to create a sha-2 sum for a file. > > Have you considered Digest? > > http://perldoc.perl.org/Digest.html Yes, I've been looking at descriptions like that and I

Re: sha-2 sum of files?

2013-06-12 Thread lee
Jim Gibson writes: > On Jun 11, 2013, at 9:44 PM, lee wrote: >> I've been googling for examples of how to create a sha-2 sum of a >> file in perl without success. What I'm looking for is something >> like: >> >> $hash = create_sha2_sum( $filename); >> >> Do you know of any examples I could l

Re: sha-2 sum of files?

2013-06-12 Thread Shlomi Fish
Hi Lee, On Wed, 12 Jun 2013 06:44:19 +0200 lee wrote: > Hi, > > what I'm trying to do is create a list of sha-2 sums of files the names > of which are stored in a file. The purpose is to verify from time to > time whether any of the listed files have been modified or not in the > meantime. >