Deleting a file while other script still appending to
- From: mahdi.sbeih@xxxxxxx (Mahdi A Sbeih)
- Date: Thu, 07 Feb 2008 02:54:19 -0800
Hi all,
I have a script that logs activities to a txt log file. I noticed that when deleting the file from another window or shell, the script stops writing to the file. I was expecting something like the unix shell, which is creating a new file and appending to it.
execute this script:
#!/usr/local/bin/perl
use FileHandle;
open(LOGFILE,">>logFile");
LOGFILE->autoflush;
while (1) {
sleep 1;
print LOGFILE ("test\n");
}
After few seconds, and from another terminal, delete the file that was created by the script, notice that the script won't stop or error out, but in the same time no new file is created.
Thanks,
Mahdi
.
- Follow-Ups:
- Re: Deleting a file while other script still appending to
- From: Chas. Owens
- Re: Deleting a file while other script still appending to
- Prev by Date: Re: Email from windows
- Next by Date: Re: Deleting a file while other script still appending to
- Previous by thread: SOAP::Lite on Leopard
- Next by thread: Re: Deleting a file while other script still appending to
- Index(es):
Relevant Pages
|