Pritish Pattanaik <pattanaikprit...@gmail.com> 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 not bother about access time.
> 3.your script need to calculate and compare an MD5 digest for each file in
> a directory ?

files in many directories, all listed in a file

MD5 apparently can result in the same hash for different file contents
and seems to be somewhat deprecated.  As far as I've been reading, it
doesn't really make a difference whether you use MD5 or sha-2 in how to
do it in perl.

> 4. stat or ls -ld can considered as useful.

File sizes do not reliably indicate whether a file has been modified or
not.

> 5. atime, mtime, and ctime

The partition is mounted with noatime option.  File times aren't
necessarily guaranteed to be preserved, like they can be modified by
backups, and atime could change because the files are accessed.

>
> I hope you it will help.
>
> Cheers,
> Pritish
>
>
>
>
>
> On Wed, Jun 12, 2013 at 11:20 AM, David Christensen <
> dpchr...@holgerdanske.com> wrote:
>
>> 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<http://perldoc.perl.org/Digest.html>
>>
>>
>> HTH,
>>
>> David
>>
>>
>> --
>> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
>> For additional commands, e-mail: beginners-h...@perl.org
>> http://learn.perl.org/
>>
>>
>>

-- 
"Object-oriented programming languages aren't completely convinced that
you should be allowed to do anything with functions."
http://www.joelonsoftware.com/items/2006/08/01.html

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to