forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Recursively delete directory... howto?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
sawang
Newbie


Joined: 06 Mar 2005
Posts: 8

PostPosted: Sat Oct 22, 2005 1:28 am    Post subject: Recursively delete directory... howto? Reply with quote

How do I recursively delete a directory the directory is not empty?
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Oct 22, 2005 2:52 am    Post subject: Reply with quote

this is complicated as you will need to delete all the files in all the subdirectories, and then delete all the empty subdirectories before deleting the main directory ... this is messy stuff

you will need to use LIST FILELIST to list your subdirectories in a list, then go to each of these to delete all the files they contain

if your subdirectories themselves contain subdirectories, then it gets really messy

may be some one has written code for this that they will be happy to share with you or perhaps someone knows a nice shortcut through a DLL or API

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Sat Oct 22, 2005 2:59 am    Post subject: Reply with quote

In VD5 You can just use Directory Delete. It works that way for me.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Oct 22, 2005 3:38 am    Post subject: Reply with quote

hi chris,

i thought so too but the help file says

Quote:
DIRECTORY DELETE removes the directory named in <path>. The directory must be empty or it will not be removed.


serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Sat Oct 22, 2005 4:12 am    Post subject: Reply with quote

Well, don't know if it's a "bug" but it deletes all for me. I use it in one of my programs
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Sat Oct 22, 2005 8:30 am    Post subject: Reply with quote

cool chris, you would know better given that you use it Smile

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
MarkTrubo
Contributor
Contributor


Joined: 27 May 2001
Posts: 148
Location: Long Island, NY

PostPosted: Sun Oct 23, 2005 11:16 am    Post subject: Reply with quote

I call an old / dangerous dos program called "zap.exe". Recursive / non-empty deleting always scares me, but sometimes you need it!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Sun Oct 23, 2005 5:55 pm    Post subject: Reply with quote

For Windows 98 and below you can also call the DELTREE command. I'm
not sure if that will work on the newer Windows OSs.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group