in reply to Perl files tests fail on RAID disk

Why do you do the -e -R tests? What do you see if you run:

my $logdir = "/log/file/location"; my $logfile = "your.log"; my $fpath = "$logdir/$logfile"; open my $fh, '<', $fpath or die "I could not read $fpath: $!\n";

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

Replies are listed 'Best First'.
Re^2: Perl files tests fail on RAID disk
by albob (Sexton) on Jun 05, 2013 at 15:43 UTC
    Hi,
    Indeed that works fine in that my program can open the file for read. Perhaps I should rework my code. I used file tests as it seemed to be a neater way of doing what I needed to do. The log file not existing is not in itself an issue, it just means I have to do a whole lot of other stuff. Thus I thought this was easier to code:

    if (-e $log) { open .... do lots of stuff... } else { do lots of other stuff }

    Regards

      Could you write something like proof of concept code - minimal script which prints output, that shows that file is not exists (-e is false) and that file opened without error. (also -f -d -R and other tests might help)

      And full details about RAID configuration and software/OS that you use + path to files (include full filenames) + ls -la directory listing