On Feb 7, 2008 5:54 AM, Mahdi A Sbeih <[EMAIL PROTECTED]> wrote:
> 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
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:
#!/u
perldoc -f unlink
-Original Message-
From: Shishir K. Singh
Sent: Friday, May 31, 2002 6:14 PM
To: Lance Prais; Perl
Subject: RE: deleting a file
use unlink
perl -f unlink
-Original Message-
From: Lance Prais [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 6:10 PM
To
use unlink
perl -f unlink
-Original Message-
From: Lance Prais [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 31, 2002 6:10 PM
To: Perl
Subject: deleting a file
Is it possible to delete a file or remove all the data using a perl command?
I am using perl on windows, can you include dos
Is it possible to delete a file or remove all the data using a perl command?
I am using perl on windows, can you include dos commands within perl
I tried to include Del in my script and it blew up.
Thanks
Lance
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Rory Oconnor wrote:
>
> I need to touch a file with a "1" in it if a condition is true, and
> either toggle the "1" to a "0" or delete the file (whichever is better,
> probably toggle) if another condition is true. Excuse my
> newbie-ness...but can anyone give me some hints as to the correct syn
Hi Rory,
Assuming that if there is a problem in opening the file then it's 0, I
hope the following code helps.
#Code Begings
if (open (INFILE, ";
close (INFILE);
} else {
$flag = 0;
}
if ($flag == 0) {
$flag = 1;
} else {
$flag = 0;
}
open (OUTFILE, ">file.txt") || die;
pr
I need to touch a file with a "1" in it if a condition is true, and
either toggle the "1" to a "0" or delete the file (whichever is better,
probably toggle) if another condition is true. Excuse my
newbie-ness...but can anyone give me some hints as to the correct syntax
for that?
thanks,
rory
Dear Japhy,
Thank you! I thought I had to open the directory then delete the
file to use unlink. Thank you again.
>On Jul 15, Teresa Raymond said:
>
>>opendir (ADS, "$filepath/") || die "Can't open directory\n";
>>if (-e $file)
>>{
>> unlink "$file";
>>}
>
>Why are you opening a directory
On Jul 15, Teresa Raymond said:
>opendir (ADS, "$filepath/") || die "Can't open directory\n";
>if (-e $file)
>{
> unlink "$file";
>}
Why are you opening a directory, but not using it? At first, I'd think
you meant to just say:
unlink "$filepath/$file" if -e "$filepath/$file";
But you sa
Please help. I am trying to delete a file. I wrote the below code
but when executed nothing happens. There is no error msg but the
file is not deleted.
opendir (ADS, "$filepath/") || die "Can't open directory\n";
if (-e $file)
{
unlink "$file";
}
else
{
print "There is no file by th
11 matches
Mail list logo