Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: -s test option returns differently in some cases

by RichardK (Parson)
on Oct 14, 2013 at 11:26 UTC ( #1058173=note: print w/replies, xml ) Need Help??

in reply to -s test option returns differently in some cases

I wonder if you're suffering from NFS attribute caching?

My guess is that it could be reading the local stale cache and has just not seen the update yet. If you sleep for more than the attribute cache timeout (set in the NFS mount) it should correct itself. You could try a loop that sleeps for one second and then tests the file and see if it ever recognises the change.

Also, have you closed that file that you're writing to? I don't remember if this will flush the cache or not & I don't have a NFS server set up it test it on.

Have you checked that the nfs mount options are the same on both machines & that the defaults didn't change between versions?

You can set noac on the nfs mount but it does slow things down. Sadly, NFS is showing it's age and doesn't make a very good cluster file system.

  • Comment on Re: -s test option returns differently in some cases

Replies are listed 'Best First'.
Re^2: -s test option returns differently in some cases
by frogsausage (Sexton) on Oct 14, 2013 at 12:11 UTC

    Aaaaaaaaaand, it is a problem with the file not being closed. Something might have changed somewhere in Perl or SuSE in between these two version (of each).

    Thank you very much for helping me out here! I'm short of 'vote' but I will come back later!

Re^2: -s test option returns differently in some cases
by frogsausage (Sexton) on Oct 14, 2013 at 12:04 UTC

    Didn't think for a second about NFS actually. Lets see...

    My NFS has:


    which are default values apparently. Therefore, I set a sleep to '3' and it didn't work "Failed". It is also much longer than the system() statement which works.

    Now, I've looked at how I am writing my file: open, print and then... nothing. I added a close statement and it works like a charm. Let me double check on that though, I might have forgotten a switch somewhere that could affect that. I'll report back soon!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058173]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2018-06-21 16:38 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.