Re: deleting files from the directory from a file list. Please Help!

2003-08-02 Thread R. Joseph Newton
perlwannabe wrote: > > Not at all. I am checking various sources for this problem. The > responses on the usenet were helpful...but the problem remains. I came to > the mailing list to have a direct dialogue with individuals rather than a > post that will get lost in two days. I am appreciativ

RE: deleting files from the directory from a file list. Please Help!

2003-07-25 Thread wiggins
On Fri, 25 Jul 2003 15:18:39 -0600, [EMAIL PROTECTED] wrote: > FYI: I have been doing perl for about two weeks, so if my answer screws you up, > don't sue me please! :D > > You would do something like this: > > foreach my $string () > { >

Re: deleting files from the directory from a file list. Please Help!

2003-07-25 Thread John W. Krahn
Perlwannabe wrote: > > Here is my problem. I want to delete the files contained in a directory > from a list contained in a file. Here is an example: > > The input file is a regular text file in the following format (call it > myfile.txt); > > item1 > item2 > item3 > item4 > > > What I w

RE: deleting files from the directory from a file list. Please Help!

2003-07-25 Thread bseel
FYI: I have been doing perl for about two weeks, so if my answer screws you up, don't sue me please! :D You would do something like this: foreach my $string () { system "cmd del *string*"; } I believe that is right. But even if I am, some of these other guys will show you a better way

RE: deleting files

2003-01-21 Thread NYIMI Jose (BMB)
C:\>perldoc -f unlink unlink LIST unlink Deletes a list of files. Returns the number of files successfully deleted. $cnt = unlink 'a', 'b', 'c'; unlink @goners; unlink <*.bak>; Note: "unlink" will not delete director

RE: deleting files

2002-07-15 Thread Bob Showalter
> -Original Message- > From: Michael Pastore [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 8:48 AM > To: [EMAIL PROTECTED] > Subject: deleting files > > > Hello All, > > Just a quick question on deleting files in Perl. > > I am trying to delete some files in a directory, but

RE: deleting files

2002-07-15 Thread Michael Pastore
M To: [EMAIL PROTECTED] Subject: Re: deleting files Michael Pastore wrote: > > Hello All, Hello, > Just a quick question on deleting files in Perl. > > I am trying to delete some files in a directory, but I do not know their > names...just ending extension... > > I ha

Re: deleting files

2002-07-15 Thread John W. Krahn
Michael Pastore wrote: > > Hello All, Hello, > Just a quick question on deleting files in Perl. > > I am trying to delete some files in a directory, but I do not know their > names...just ending extension... > > I have tried: > > One way: > > unlink <*.dat>; > unlink <*.p1>; > > Another wa

RE: deleting files

2002-07-15 Thread Michael Pastore
Got it working :) Thanks to Mike, Nikola and Janek... Have a wonderful day!!! Mike -Original Message- From: Mike(mickalo)Blezien [mailto:[EMAIL PROTECTED]] Sent: Monday, July 15, 2002 9:04 AM To: Michael Pastore Cc: [EMAIL PROTECTED] Subject: Re: deleting files Hi Michael

RE: deleting files

2002-07-15 Thread Nikola Janceski
no offense, but using that method you won't know if all the files were really removed. > -Original Message- > From: Janek Schleicher [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 8:01 AM > To: [EMAIL PROTECTED] > Subject: Re: deleting files > > >

Re: deleting files

2002-07-15 Thread Mike(mickalo)Blezien
Hi Michael, One way is to read the directory that you want to delete the files. This works very well for me: my $DIR = '/path/to/folder'; my($deletefile,$removefile); opendir (DIR, "$DIR") or die $!; my @files = grep(/\.(dat|pl)/i,readdir(DIR)); closedir (DIR); foreach $removefile (@files)

Re: deleting files

2002-07-15 Thread Janek Schleicher
Michael Pastore wrote at Mon, 15 Jul 2002 14:48:12 +0200: > I am trying to delete some files in a directory, but I do not know their >names...just ending > extension... > > I have tried: > One way: > > unlink <*.dat>; > unlink <*.p1>; > > Another way: > > unlink glob(".dat"); > unlink glob("

RE: deleting files

2002-07-15 Thread Nikola Janceski
foreach $file (glob("/path/to/files/*.dat"), glob("/path/to/files/*.p1")){ unlink($file) || die "cannot unlink file $file: $!"; } > -Original Message- > From: Michael Pastore [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 15, 2002 8:48 AM > To: [EMAIL PROTECTED] > Subject