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
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
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
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
> "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.
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
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
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
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
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,
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
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
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,
13 matches
Mail list logo