Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

(Kozz) Re: More Eyes

by Kozz (Friar)
on Aug 22, 2000 at 08:52 UTC ( #28974=note: print w/replies, xml ) Need Help??

in reply to Re: More Eyes
in thread More Eyes, Please

tye, Thanks for the input. I tried your suggestion, and when configured as you suggest, the flock dies with the message "Resource temporarily unavailable". Wow. What does that mean? I mean, it says what it says, yeah. But what does it really mean, in terms of flocking? It's quite strange. When I made a temp directory of my own "/home/username/htdocs/tmp" and made it chmod 777, it was able to flock just fine.
So is there an issue with flocking files which are not in your own userspace (i.e. /tmp or something), perhaps?

Update: Incidentally, I got this very same result with the script on two different machines: one running Slack 7, and the other running FreeBSD 3.1
Update 2: I just had to try the simplest version, so I did this:
#!/usr/bin/perl use Fcntl qw( :flock ); my $tempfile="/tmp/$$.temp"; print "Content-type: text/html\n\n"; print "Testing flocking now.<BR>\n"; open(TMP, "+> $tempfile") or die "Could not open tempfile: $!"; flock(TMP, LOCK_EX|LOCK_NB) or die "no lock: $!"; seek(TMP, 0, 0); print TMP "Blah blah blah"; # just to test close(TMP); unlink $tempfile; print "That seemed to go just fine.\n";
And it ran just fine. Go figure. I'm quite puzzled.

Replies are listed 'Best First'.
RE: (Kozz) Re: More Eyes
by Jonathan (Curate) on Aug 22, 2000 at 13:56 UTC
    Hmmm. Interesting, in some versions of Unix /tmp is held in memory I haven't access to your ?nixs but I wonder if that has a bearing on things?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2018-04-25 21:02 GMT
Find Nodes?
    Voting Booth?