Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / File deleting

Author
Message
Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 6th Dec 2005 11:39
I recently created a program that deleted all files within a given directory. But then I lost the code. Does anyone know how I can do this? I think it was something like, "if path exist("directory")=1 then delete directory "directory"

but i've tried it since and it won't work.

I am a Christian and I know that God loves me. That is what makes my life so great!
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 6th Dec 2005 11:58
what sort of error?

Can't delete directory or directory does not exist?

...maybe one day I'll finish a project
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 7th Dec 2005 06:41
Directories have to be empty before you can delete them. This is a Windows rule - not a problem with DB.

TDK_Man

Sonic 91 Software
20
Years of Service
User Offline
Joined: 19th Mar 2005
Location: In a Cryptic Crossworld!
Posted: 7th Dec 2005 11:48
The strange thing is, it didn't come up with any error messages, yet the other day, when I used DB to delete a screen saver I made, i set the directory to "Dark Basic\My Projects\Screensaver" and deleted the "screensaver" directory, without any error messages at all. It didn't delete the actual directory, but it deleted all the files within the directory! Wierd!

I am a Christian and I know that God loves me. That is what makes my life so great!

Login to post a reply

Server time is: 2025-05-22 20:10:19
Your offset time is: 2025-05-22 20:10:19