Re: -e fails sometimes



Asterbing <no@xxxxxxxxxx> wrote:
In article <1143835705.181151.202910@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
mritty@xxxxxxxxx says...
Please post a short-but-complete script
that demonstrates the error you're having.


This code, on some stations, on a LAN under Win32, sometimes, display
"C:\TEST\stats\histo.gif not found" even if the file exists on disk in
this path.

#!/usr/bin/perl
use strict;
print "Content-type: text/html\n\n";
my $file = "C:\\TEST\\stats\\histo.gif";
if (! -e $file){ print $file." not found"; }

Print the error message, it might be helpful:

if (! -e $file){ print $file." not found: $!"; }

else { print $file." found"; }
exit 0;

What do you mean by sometimes? If you put this in a loop and executed it
100000 times on the exact same $file, while nothing else is touching that
file, would it sometimes fail and sometimes succeed? Or does the sometimes
that it fails have a different $file than the sometimes that it succeeds?

Are files being added and removed while all of this going on? If so, how
do you know that the file did in fact exist on disk at the exact instance
that -f was executed?

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages

  • Re: File Merge
    ... You cannot know what happened until it actually happens -- so the only way to know that you have reached end-of-input is to try to read something and get a failure. ... might fail: for example, input from a disk could fail in the event of a head crash, or input from a keyboard could fail if you spilled Coke Classic into the mechanism and shorted it out with caramelized sugar. ... Most of C's input functions report a kind of "generalized failure" no matter what the cause -- and the *only* reason feof() exists is to let you figure out that cause. ...
    (comp.lang.c)
  • Re: [Question] Does the kernel ignore errors writng to disk?
    ... > as if the kernel may be ignoring write errors to disk. ... will fail with a time-out. ... File data gets flushed to a queue. ... You can observe the behavior by mounting a floppy disk and ...
    (Linux-Kernel)
  • Re: SQL 2000 extra instance into same group
    ... There is a trace flag that will disable the disk dependency check, ... If you had multiple instances running in the same resource group, ... If one were to fail, ... Every instance requires its own group/disk/IP/networkname in a cluster. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Yet another [Un]Zip behavior quirk. Non-stupid opinions sought.
    ... > first time, be fully allocated at once, instead of incrementally. ... >> precautions against exceeding disk quota or filling up the disk. ... > fail to see any difference from the previous behavior. ...
    (comp.os.vms)
  • Re: Trapping Errant DMA Disk Ops
    ... Apparently, after HD's, powersupplies are the most failure ... The HD is definitely the part most likely to fail, ... the disk if it is going has no Linux stuff on it. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)