[sf-perl] Bug in perl (or does -r not do what I think?)
Dan Boger
dan at peeron.com
Fri Jun 6 17:31:59 PDT 2008
On Fri, Jun 6, 2008 at 5:28 PM, Steve Fink <sphink at gmail.com> wrote:
> Also... what are you doing it for? There are a number of legitimate
> uses, but it's also a common race condition -- just because something
> is readable at the moment you checked doesn't mean that it'll still be
> readable when you try to read it. So if you really depend on it being
> correct, then you'll have to just try to do the operation and check
> failure then.
>
I was just testing because a following operation blows up badly if the file
isn't readable, and doesn't give useful error messages (specifically, GD's
new PNG from file call). So I add this test so that I can post my own error
and not try the GD call.
I did end up adding an 'open' call to see if I can actually read it.
--
Dan Boger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20080606/28433793/attachment.html
More information about the SanFrancisco-pm
mailing list