[futurebasic] Re: [FB] Removing files

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2010 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Sun, 24 Jan 2010 12:22:13 +0100
Le 24/01/10 10:38, Piet en Claudine a écrit :

> Now the problem,
> Every file has a number as name (M) eg 3208, 3205, 3650,....
> All this filenames are stored in a file "HD:Soft:Optimafiles:Lengtes" to
> remember what files have to be removed if the program ends
> So I create the complete string
> FILEN$="HD:Soft:Optimafiles:"+STR$(M)
> But now
> KILL FILEN$ (does not remove the file)
> If I do
> KILL "HD:Soft:Optimafiles: 3208" (the file is removed)
> Is there an alternative to remove it by the full path stored in FILEN$
> Or can I remove alle the files in the folder "HD:Soft:Optimafiles" at
> once by some way ?

Hello Piet,

Perhaps you have a problem with the leading space in your file names due 
to the conversion performed by the STR$ function.

Otherwise, you can delete the whole sheebang by scanning the folder 
regardless of the files it contains. I remember having adaptated an old 
collection of routines by Apple, namely MoreFilesX, that featured such a 
function. As far as I can see, it has disappeared from the recent FB 
Package. At the time  (at least 6 years ago), it was a modern way to 
deal with files since it required the use of FSRef.

 From a full path, like you've shown above, I guess you can get and 
FSSpec for your folder, then convert that FSSpec to an FSRef. If you're 
interested, I can dig it out from my archives unless someone else chimes 
in to provide a better solution.