Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Directory listing for a date range

by jettero (Monsignor)
on Jan 11, 2007 at 17:45 UTC ( #594205=note: print w/ replies, xml ) Need Help??


in reply to Directory listing for a date range

Without getting into specific implementation details; personally, I'd store a Digest::SHA1 hash along with a file size and date stamp in a file or database table. There is a risk of collisions, but it's probably pretty small if you also compare the file size.

To make sure it worked right even when there were no databases to connect to, I'd probably use DB_File or Storable. Even DBD::SQLite would be an excellent choice for that. I think it's largely a matter of preference, but if you like the look of Storable.pm, be sure to think about splitting it up by month and/or directory. Otherwise, reparsing that file into memory every time the program runs could get expensive.

Then, when you need to generate file change reports, you can just work off the simple database and you're done!

-Paul


Comment on Re: Directory listing for a date range

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://594205]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-09-16 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (22 votes), past polls