Re: to delete a file

2001-06-21 Thread Bradford Ritchie
> for ($i = 0; $i < @ARGV.""; ++$i) { Why do you append an empty string? I can't figure out what condition would make that necessary. Won't @ARGV *always* be evaluated in a scalar context by the '<' operator? -- Brad From: "Chris Hedemark" <[EMAIL PROTECTED]> > #!/usr/bin/perl > # > # Name:

Re: to delete a file

2001-06-21 Thread Chris Hedemark
run faster with less resource overhead. - Original Message - From: "n6tadam" <[EMAIL PROTECTED]> To: "Stéphane JEAN BAPTISTE" <[EMAIL PROTECTED]>; "PERL" <[EMAIL PROTECTED]> Sent: Thursday, June 21, 2001 10:04 AM Subject: Re: to delete a

Re: to delete a file

2001-06-21 Thread Chris Hedemark
#!/usr/bin/perl # # Name:unlinkdemo.pl # Author: Chris Hedemark <[EMAIL PROTECTED]> # Purpose: Demonstrate use of the unlink function. if (!@ARGV) { die "No arguments!\n"; } for ($i = 0; $i < @ARGV.""; ++$i) { if (-e $ARGV[$i]) { unlink ("$ARGV[$i]"); } else { print "File

Re: to delete a file

2001-06-21 Thread Nigel Wetters
To delete a file: unlink($filename) or die "can't delete $filename:$!\n"; To delete lots of files: unlink(@filenames) == @filenames or die "couldn't unlink all of @filenames: $!\n"; To delete a folder: use File::Path; rmtree($directory); >>> Stéphane JEAN BAPTISTE <[EMAIL PROTECTED]> 06/21/01

Re: to delete a file - That's OK

2001-06-21 Thread Stéphane JEAN BAPTISTE
It's allright! thank you Stéphane JEAN BAPTISTE a écrit : > How can I delete a file ? > > thanks

Re: to delete a file

2001-06-21 Thread n6tadam
MAIL PROTECTED]> Sent: Thursday, June 21, 2001 3:11 PM Subject: Re: to delete a file > On Thu, Jun 21, 2001 at 03:04:21PM +0100, n6tadam ([EMAIL PROTECTED]) spew-ed forth: > > Hi, > > > > [snip] > > > > > Of course, from a perl script, you can either use

Re: to delete a file

2001-06-21 Thread Kevin Meltzer
On Thu, Jun 21, 2001 at 03:04:21PM +0100, n6tadam ([EMAIL PROTECTED]) spew-ed forth: > Hi, > [snip] > > Of course, from a perl script, you can either use: > > system("/bin/rm -f /path/to/filename"); > > or > > `rm -f filename` Don't do that. Just use unlink() perldoc -f unlink Cheers, K

Re: to delete a file

2001-06-21 Thread n6tadam
Hi, Usually, one uses the following command (from the shell prompt) "rm /path/to/file/filename" To supress the confirmation message, use: "rm -f /path/to/file/filename" To delete recursively (i.e. a directory), and make it verbose to the screen: rm -rfv /path/to/directory Does that help. O

RE: to delete a file

2001-06-21 Thread Yacketta, Ronald
unix: rm filename winblows: del filename oh wait, do you mean in perl ;) (wise a$$ arent I?) perldoc -f unlink > -Original Message- > From: Stéphane JEAN BAPTISTE > [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 21, 2001 10:03 AM > To: PERL > Subject: to delete a file > > > > >

Re: to delete a file

2001-06-21 Thread victor
try the unlink command. Stéphane JEAN BAPTISTE wrote: > How can I delete a file ? > > thanks