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:
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
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
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
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
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
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
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, "
>>>>> "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
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
(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
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
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
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
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.
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
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
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
How do I flock(); with strict subs in effect?
Thanks,
--
Kyle
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> 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
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
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
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
-
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
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
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
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
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
28 matches
Mail list logo