1. Deleting Files
- Posted by mjwalter at deakin.edu.au Jul 17, 2001
- 384 views
I know this is a lame question, but I am new to euphoria, Using Win32lib or any other library, what command can be used to delete a number of files in a folder using wildcards (eg. *.doc). I have used the command for deleting 1 file (deleteFile) but cant get it to delete a whold lot simultaneously. Thanks Mark
2. Re: Deleting Files
- Posted by Kat <gertie at PELL.NET> Jul 17, 2001
- 389 views
On 18 Jul 2001, at 11:01, mjwalter at deakin.edu.au wrote: > > > I know this is a lame question, but I am new to euphoria, > Using Win32lib or any other library, what command can be used to delete a > number of files in a folder using wildcards (eg. *.doc). I have used the > command for deleting 1 file (deleteFile) but cant get it to delete a whold > lot simultaneously. Get the directory listing into a sequence, check it for the files you want to delete, and delete them? Or you could drop a .bat file into the directory, with dos commands to do it written to the .bat file, and exec the .bat file. Kat
3. Re: Deleting Files
- Posted by pampeano at ROCKETMAIL.COM Jul 18, 2001
- 393 views
Well, the easiest and safest way you can use, is to use the euphoria dir() function to get the file listing of that directory. Then look trough the sequence looking for the files with that extention and using deleteFile() with each one. Untested code: constant Where = "C:\My Documents" sequence dirlist dirlist = dir(Where) for I = 1 to length(dirlist) do if find(".doc",dirlist[I][D_NAME]) then -- D_NAME is defined in file.e deleteFile(Where & dirlist[I][D_NAME]) end if end for Best Regards, Guillermo Bonvehi > Date: Wed, 18 Jul 2001 11:01:50 +1000 (AUS Ea > From: mjwalter at deakin.edu.au > Subject: Deleting Files > > > > I know this is a lame question, but I am new to euphoria, > Using Win32lib or any other library, what command can be used to > delete a > number of files in a folder using wildcards (eg. *.doc). I have used > the > command for deleting 1 file (deleteFile) but cant get it to delete a > whold > lot simultaneously. > > Thanks > Mark