Re: FLOCK

2007-05-29 Thread Lou Hernsen
sy made that up but it looks like the perl code I see ... super secret coded perl so I use semephore files and flock...maybe it will help you. Lou Hernsen - Original Message - From: "Akbar Ehsan" <[EMAIL PROTECTED]> To: Sent: Tuesday, May 29, 2007 4:33 PM Subject:

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

Re: FLOCK

2007-05-29 Thread Sean Davis
reading about FLOCK and feel it will not server the purpose. I am hoping to find out if someone knows about some other function/module to lock a file for a brief period of time. In this situation, I would tag each file with a unique identifier (a session ID, for example, like

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

FLOCK

2007-05-29 Thread Akbar Ehsan
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 a file

Re: Problem with flock

2004-09-27 Thread Gunnar Hjalmarsson
Wiggins d Anconia wrote: You haven't shown us your 'use' statements, I suspect you didn't import the LOCK_ constants, perldoc -f flock Adding: use Fcntl ':flock'; # import LOCK_* constants Should help. I think you need to do: use Fcntl qw(:DEFAULT :flock); or

Re: Problem with flock

2004-09-27 Thread Wiggins d Anconia
hat I am overlooking? > You haven't shown us your 'use' statements, I suspect you didn't import the LOCK_ constants, perldoc -f flock Adding: use Fcntl ':flock'; # import LOCK_* constants Should help. If it doesn't post the new errors, http://danconia.org

Problem with flock

2004-09-27 Thread Rick Triplett
Declare the 'working' datahash, then tie it to file my %datahash; my $db = tie %datahash, 'DB_File', $file_to_view, O_RDWR | O_CREAT, 0644 or die "Can't initialize database: $!\n"; my $fd = $db->fd(); # get a file descriptor open DATAFILE, "

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> fl

flock() semantics?

2003-10-31 Thread Shaun Fryer
Hi all, I'm writing an app which uses a flat file to store a *short* list of simple key/value pairs. However having read the flock() man page, I'm unsure about whether I need to seek() in cases where I'm not merely appending to the file (such as when deleting a record). su

Flock and Sleep

2003-08-14 Thread Sara
(sub get_number { open(NUMBER,">>data.txt"); flock (NUMBER, 2); Do blah blah blah close (NUMBER); closing a file automatically removes the lock?? or should I have to unlock it by placing flock (NUMBER, 8); close (NUMBER); My second question is how I can delay the execution

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

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

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 diff

Flock Test...

2003-07-31 Thread Sara
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. Sara.

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

flock and Fcntl

2003-01-09 Thread Rene Verharen
Hi all, Do I always need use Fcntl qw(:flock); if I want to use flock(FILEHANDLE, 2) in my scripts ? I'm asking because some scripts I found on the web do and some other don't, although they all use flock. Is there also a nice way to omit the "flock() unimplemented on

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("(.*)&quo

flock(); with strict subs

2002-07-31 Thread Kyle Babich
How do I flock(); with strict subs in effect? Thanks, -- Kyle -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Does Windows support flock?

2002-07-13 Thread Connie Chan
> I thought Windows doesn't support Perl's flock, but I heard that it does. > Is it true? Yes, flock can use in Win32 OS. > > I've seen more Perl programs that create another temporary file for marking > a file as locked than programs that use the flock functio

Does Windows support flock?

2002-07-13 Thread Octavian Rasnita
Hi all, I thought Windows doesn't support Perl's flock, but I heard that it does. Is it true? I've seen more Perl programs that create another temporary file for marking a file as locked than programs that use the flock function. If Windows and Unix can use the flock functi

Re: lock file, flock or what?

2002-02-27 Thread W P
http://www.perldoc.com/perl5.6.1/pod/func/flock.html From: "zaka rias" <[EMAIL PROTECTED]> Subject: lock file, flock or what? > i wanna know what is perl command to lock a file, > honestly i dont understand what is that mean with lock > a file, im on linux, if i w

lock file, flock or what?

2002-02-27 Thread zaka rias
i wanna know what is perl command to lock a file, honestly i dont understand what is that mean with lock a file, im on linux, if i want to lock my file, i'll just need to set up permission, so...maybe anyone give me an example code for lock/flock command? thanks a lot zaka -

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-compa

flock()

2001-10-14 Thread Stephan Tinnemeyer
Hello! What will happen when a script crashes immediately after locking a file (exclusively) with Perl's flock() function? I understand that this will leave the file locked until the owner (or root) will unlock it manually. Does anybody have any experiences and/or recommendations or do sc

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 regu

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 causi

flock()

2001-07-31 Thread Adam Carson
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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For