in reply to Re: (Ovid) Re: Writing to a file
in thread Writing to a file

There is flock, which would lock the file. But, each process has to request what the flock status is and I'm not very conversant on how that works.

Now, what you're saying is that you're going to run this script on separate workstations. Why not just run it, store the logfile locally, then have another script which gathers together all the data?

------
/me wants to be the brightest bulb in the chandelier!

Vote paco for President!

Replies are listed 'Best First'.
Re: Re: Re: (Ovid) Re: Writing to a file
by swngnmonk (Pilgrim) on Aug 21, 2001 at 01:20 UTC
    Something in the back of my mind is scratching me and telling me there might be problems with using flock over NFS (I assume you're using NFS if all these workstations are writing to the same file?)

    Another potential approach? how about saving files as:

    localtime().hostname.extension?

    That way, you can sort the files date/time order simply by doing an ls -l.

    Note - this would assume that all the machines are synchronized to the same clock.