ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
Re: Determing if a file has changed
by $Bill Luebkert other posts by this author
Jan 31 2003 5:03PM messages near this date
view in the new Beta List Site
Re: Determing if a file has changed | RE: Win32::lanman?
Neil wrote:
>  
>  Basically, I want to open a file, read the contents, and munge the data and
>  write it out to a second file.
>  
>  BUT ... if the original data file changes - I'd like to reparse/remung
>  before writing.
>  
>  Unfortunately, last mod time does not work IF the data was changed twice in
>  the last second.
>  
>  Size doesn't work because a byte chould be changed with no change in
>  size..and twice in the last second.
>  
>  I was hoping that there could be some kind of checksum solution.

You could checksum the file after slurping it using unpack or Digest::MD5

You could then later on check the file again and see if the checksum is
different.  Probably not necessary though - the mtime is probably sufficient
if the content changes that often.  You could also check into serial use
of the file as a solution (some sort of locking if you can modify the
other writer).

-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:dbe@[...].com
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Neil
Alan Dickey
$Bill Luebkert

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved