The Daily Click ::. Forums ::. Klik Coding Help ::. Best way to delete all files within a directory.
 

Post Reply  Post Oekaki 
 

Posted By Message

DEC Stuff



Registered
  07/07/2003
Points
  1348
23rd September, 2003 at 18:06:26 -

Ok, I have tackled every problem I have had making the application "DEC Security Tools". But this one has me stumped. The program itself, I might add, is fairly complex. Lots of loading/saving and decrypting/encrypting going on.

Anyway, there is a portion called the "password profiler". This tool lets you save passwords and information that goes along with it in an array, which is then decrypted. To view the files you simply login, and the program copies all the files into a "temp" directory and decrypts them. They can now be opened and read very easily. The problem is, they need to be deleted. I tried deleting the directory and recreating it. I will go back and doublecheck to make sure that didn't work. Otherwise, does anyone have an idea as to how I should go about deleting all the temporary files?

Seems simple enough(I thought so). But, then again, I haven't been trying to long.

 
http://www.decstuff.net

ShadowCaster

Possibly Insane

Registered
  02/01/2002
Points
  2203
24th September, 2003 at 00:47:21 -

I'm pretty sure the File object doesnt do any extra processing beyond the capabilities of the DLL which it draws its commands from. In that case, it would be impossible to remove a directory that isnt empty.

You can use a Fast Loop to remove all the files pretty easily. Though if you havent had a lot of experience using the Fast Loop system, you could always do it the longer (but easier) way by creating a list object and using it to load the directory structure. Then simply go through the list one by one while there are still files left in it, removing them as you go along. Then once the list object is empty, remove the directory.

MMF has a function to load the files from a directory into a list box. Just check out the actions, it's pretty easy to find.

Mike

 
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
24th September, 2003 at 11:49:21 -

You can use the Tree object or the Recursive File object - the former lets you view all files and directories within a directory, and the latter has a specific function to delete everything within a folder. I can't remember the link for Recursive File but try http://objects.ebw.ca/

 
n/a

DEC Stuff



Registered
  07/07/2003
Points
  1348
24th September, 2003 at 17:04:26 -

Thanks Chris Branch. Once again, you saved the day.

 
http://www.decstuff.net
   

Post Reply



 



Advertisement

Worth A Click