[Orca-users] Stopping 'file did exist and is now gone' message(s).

Blair Zajac blair at orcaware.com
Sun Nov 24 13:30:01 PST 2002


"isaac r." wrote:
> 
> Blair, et.al, -
> 
> Point well taken.
> 
> See the attachment. Its an improved "one-liner"
> that checks for a file with ANY extension.
> The "time" hour check is gone.

OK.

> 
> Explicit compression extensions (.gz,.tar.Z, etc. are
> a breeze to customize.  By  the same token, I have not
> done that because  newer compression methods
> might become available and you probably don't want to
> have to maintain this segment of code WITH ALL
> possible
> compression methods, especially every time
> there's a new compression algorithm with a new file
> extension that makes the headlines ...
> 
> Give an attachment a try.

Will do.  I think we also want to check the date of the files with
the suffix to check if the file was just created since Orca last
stat'ed it.  Otherwise the file could be an old one or something
else.

> 
> What I noticed is that unless you have a newer
> (not sure which exactly) version of Perl,
> glob() appears to complain if it does not
> evaluate to true.

What's the exact error you're getting?  In scalar context, glob may
return unless, which you are explicitly comparing to '', which will
cause Perl to warn about using an undefined value.  In this case, you
don't need to compare to anything, just test if it is true.

> 
> Perl 5.8 (again, might've been fixed earlier) silences
> glob () even if it fails - [behaviour that's to be
> expected]
> 
> Thanks and regards,
> -I
> 
> % diff SourceFile.pm SourceFile.pm.original
> 767,780c767
> <
> < # ---------------------------------------------------------
> < # Isaac here - 11/23/2002 - making a modification to minimize warning emails
> < # by checking if the file might have possibly had its extension
> < # changed (by being compressed, most likely).
> < # If it did, then do not send the warning email and ignore the
> < # fact that the file is gone (i.e. compressed). Otherwise, send
> < # an email because the file with a prefix name is no longer in this directory.
> < # ---------------------------------------------------------
> < #  if ($file_status == -1) {
> < #   if ($file_status == -1) && (`/bin/date '+%H'`!='00')  {
> <
> <    if ($file_status == -1) && ( glob("$sfile_fids[$fid].*") eq '' )  {
> <
> ---
> >   if ($file_status == -1) {


Finally, when you send a diff, you want to list the original file
first and then the modified one on the command line.  This generates
a patch that when I run it through `patch' takes my unmodified file
and converts it into your version of the file.  The patch you sent
does reverses the direction.

Best,
Blair

-- 
Blair Zajac <blair at orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/



More information about the Orca-users mailing list