Re: FLOCK

2007-05-29 Thread Lou Hernsen
As much as I would like to use a database, like MySQL, I can't find an example of the code that isn't in a perl formay I can read and understand, I don't know alot about perl and its assumed vars like $_ and the super compressed codes using {[\f\t\t/t/y/g/d/d\.s1?]} .. yeah.. i jusy made that up bu

Re: FLOCK

2007-05-29 Thread Jay Savage
On 5/29/07, Akbar Ehsan <[EMAIL PROTECTED]> wrote: Hello Everyone, I am attempting to lock a file using FLOCK. I understand the FLOCK is an advisory lock and that it does not prevent any other process/program from "clobbering" the file even when the lock in on the file. Is there anything I shou

Re: FLOCK

2007-05-29 Thread Sean Davis
Akbar Ehsan wrote: Thanks for the response. Here is the situation. We have a web form that creates a tab-delimited text file. We want to lock this file to clean up the file, may be for a minute, so that if anyone submits a form request, it does not get written to the. I have been looking at and

Re: FLOCK

2007-05-29 Thread Sean Davis
Akbar Ehsan wrote: Hello Everyone, I am attempting to lock a file using FLOCK. I understand the FLOCK is an advisory lock and that it does not prevent any other process/program from "clobbering" the file even when the lock in on the file. Is there anything I should look into to apply a lock on

Re: flock() semantics?

2003-11-01 Thread Randal L. Schwartz
> "Shaun" == Shaun Fryer <[EMAIL PROTECTED]> writes: Shaun> open(OUT, ">$file"); Shaun> flock(OUT, LOCK_EX); No point here. You've already killed the file, non exclusively, and then you get a flock. Pointless. Shaun> flock(OUT, LOCK_UN); Rarely needed, almost always dangerous.

Re: Flock and Sleep

2003-08-14 Thread Oliver Schnarchendorf
On Fri, 8 Aug 2003 02:32:05 +0500, Sara wrote: > open(NUMBER,">>data.txt"); > flock (NUMBER, 2); > close (NUMBER); > closing a file automatically removes the lock?? The answer is yes. When you close files they will automatically un-locked. One thing though, you might want to use the fcntl module

Re: Flock and Sleep

2003-08-06 Thread Bob Showalter
Sara wrote: > (sub get_number { > open(NUMBER,">>data.txt"); > flock (NUMBER, 2); Use the constants from the Fcntl module. > > Do blah blah blah > > close (NUMBER); > > closing a file automatically removes the lock?? Yes. > or should I have to > unlock it by placing > > flock (NUMBER, 8); > clo

Re: Flock Test...

2003-08-01 Thread zentara
On Wed, 30 Jul 2003 02:14:45 +0500, [EMAIL PROTECTED] (Sara) wrote: >What could be the simplest test to check 'flock' working on your server or not? > >except for writing to support team of host ::)) > >Thanks for any input. Start the following script in 2 different terminals or xterms simultaneou

Re: flock and Fcntl

2003-01-09 Thread Wiggins d'Anconia
See perldoc -f flock, but specifically, no you do not need the 'use' statement with the way you are calling flock, that is with the '2' instead of using one of the "symbolic" names that Fcntl:flock provides, from the aforementioned perldoc: "OPERATION is one of LOCK_SH, LOCK_EX, or LOCK_UN, pos

Re: flock(); with strict subs

2002-08-02 Thread Steve Grazzini
Kyle Babich <[EMAIL PROTECTED]> wrote: > How do I flock(); with strict subs in effect? flock is a builtin. flock($fh, 2); If you want the symbolic constants, you need to use Fcntl qw/:flock/; flock($fh, LOCK_EX); -- Steve perldoc -qa.j | perl -lpe '($_)=m("(.*)")' -- To unsubscribe,

Re: flock()

2001-10-15 Thread RaFaL Pocztarski
Stephan Tinnemeyer wrote: > What will happen when a script crashes immediately after locking a file > (exclusively) with Perl's flock() function? If the process is killed then all locks are released (in Linux and AFAIK 4.2BSD where flock comes from, so every system with BSD-compatible flock shou

Re: flock()

2001-08-17 Thread Xavier
Adam Carson wrote: > does anyone know what needs to be loaded to use flock()? I am on a win98 > box with IndigoPerl. > > Adam Carson > MIS Department > Berkeley County, SC On regular linux perl you sh

Re: flock()

2001-07-31 Thread Brett W. McCoy
On Tue, 31 Jul 2001, Adam Carson wrote: > does anyone know what needs to be loaded to use flock()? I am on a > win98 box with IndigoPerl. Be careful -- I think flock uses system calls that aren't available (or emulated) on Windows 98. See the perldoc on flock -- if it's causing a fatal error,