RE: Little code fragment request (Is this code ok?)

2002-05-07 Thread Bob Showalter
> -Original Message- > From: Rafael Cotta [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 07, 2002 2:15 AM > To: [EMAIL PROTECTED] > Subject: Re: Little code fragment request (Is this code ok?) > > > Well, after searching I come to this: > > #

Re: Little code fragment request (Is this code ok?)

2002-05-06 Thread drieux
On Monday, May 6, 2002, at 11:45 , Scot Robnett wrote: > Is this on UNIX? Somebody on the list please correct me if I'm wrong, but > I don't believe flock will work on Windows, and I have no idea about Mac. I would presume that under OSX - since it has flock(2) - persuant to the perldoc -f flo

Re: Little code fragment request (Is this code ok?)

2002-05-06 Thread Rafael Cotta
Yes, it is UNIX. I also read it won't work on Windows. Rafael "Scot Robnett" <[EMAIL PROTECTED]> escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Is this on UNIX? Somebody on the list please correct me if I'm wrong, but I don't believe flock will work on Windows, and I have no

RE: Little code fragment request (Is this code ok?)

2002-05-06 Thread Scot Robnett
lto:[EMAIL PROTECTED]] Sent: Tuesday, May 07, 2002 1:15 AM To: [EMAIL PROTECTED] Subject: Re: Little code fragment request (Is this code ok?) Well, after searching I come to this: #--- sub WriteLog { open(OUTF,">>$filenamedate.dat") or die("Could

Re: Little code fragment request (Is this code ok?)

2002-05-06 Thread Rafael Cotta
Well, after searching I come to this: #--- sub WriteLog { open(OUTF,">>$filenamedate.dat") or die("Couldn't open $filenamedate.dat for writing: $!"); # This locks the file so no other CGI can write to it at the # same time... flock(OUTF,2); # Reset the file pointer to the e

Re: Little code fragment request

2002-05-06 Thread Rafael Cotta
Ehehe.. but I don't know how to lock. I always see examples that give me the impression that if the file is locked, because the script is writing to the file this will fail. Am I right or lock will wait the file stop being used and try to lock? Rafael "Drieux" <[EMAIL PROTECTED]> escreveu na

Re: Little code fragment request

2002-05-06 Thread drieux
On Monday, May 6, 2002, at 09:35 , Rafael Cotta wrote: [..] > Can someone give me a little function that will receive a filename and a > string, and append this string to the file referenced by filename? you mean something like: ### sub MakeTmpFile { ### my ($file, @mlist ) = @_; ### op

Little code fragment request

2002-05-06 Thread Rafael Cotta
Hi all, I know in this newsgroup nobody like to answer posts like "Please, make my homework!", and I am not talking about homework at all. Can someone give me a little function that will receive a filename and a string, and append this string to the file referenced by filename? My problem is tha