RE: Determing if a file has changed
by Stovall, Adrian M. other posts by this author
Jan 31 2003 4:57PM messages near this date
view in the new Beta List Site
RE: Special Tags
|
RE: Determing if a file has changed
> -----Original Message-----
> From: Neil [mailto:neil@[...].com]
> Sent: Friday, January 31, 2003 10:41 AM
> To: perl-win32-users@[...].com
> Subject: RE: Determing if a file has changed
>
>
> -----Original Message-----
> From: Neil [mailto:neil@[...].com]
> Sent: Thursday, January 30, 2003 11:43 PM
> To: perl-win32-users@[...].com
> Subject: Determing if a file has change ....
>
>
> What is the best way of determing if a file has changed since
> it was last read ?
>
> I have thought about looking at last mod time - but if that
> was less than one second ago ....
>
> Thanks,
> Neil
>
> ----- Original Message -----
> From: Tillman, James
> To: 'Neil' ; perl-win32-users@[...].com
> Sent: Friday, January 31, 2003 5:36 AM
> Subject: RE: Determing if a file has change ....
>
>
> You might be able to use Win32::ChangeNotify, which works
> real time on files or entire directories. It does, however,
> require that your script be continuously running. If that's
> not the case, I'd use last mod time as you suggested.
>
> jpt
>
>
> Thanks jpt ... I am familiar with ChangeNotify - but its not
> really what I want....
>
> 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.
>
> Thanks,
> Neil
>
Maybe it would help to tell us why you need to check the
file...depending on the size of the file, and the type of check you want
to do, the result you get could be out of date before you determine it,
anyway (since you say the file changes more often than once per second).
perl -e "sub Sub{return reverse(@_);}$i='ohce';$_='.$yyye k ca i Xl
$yyye jX $yyyehto ZfX tq $uQ';s+[ \$]++g;s-j-P-;s^yyy^r^g;s:i:H:;s!X!
!g;s|Z|n|;s*Q*J*;s{q}{s}g;s(f)(A);system(join('',Sub(split('',$i))),(joi
n('',Sub(split('')))));"
To the optimist, the glass is half full.
To the pessimist, the glass is half empty.
To the engineer, the glass is twice as big as it needs to be.
Adrian "Okay, I won't top-post unless it's an emergency" Stovall
>
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|