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 / delete directory wont delete the directory ?

Author
Message
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Mar 2003 11:39
I`m trying to use the command `DELETE DIRECTORY`, but all its doing is deleting the files within the specified directory, but not the directory itself ?
I have tried :

delete directory "x"
delete directory "x" ( agian - to see if it worked in two stages)

and also tried :

delete directory "x"
delete file "x" ( as the get file name command finds directories too )

but I just cant get the directory to be removed from the hard drive, - even the DB example doesnt work ?

any ideas ????
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Mar 2003 11:45
hmm, I just realised, that I can not delete the directory in windows explorer either, while DB is open ( even if it not running any code ) - windows complains that it is in use ?, but as soon as I close DB, the directory can be deleted ?

gonna try to save a complied EXE, see if it works then, as I cant have to close the program I`ve coded, each time I want to delete a fle/directory!

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Mar 2003 11:51
I just tried the code, while compiled, but it still only deletes the files within the specifed dir?

any ideas please!!

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Mar 2003 18:54
ok, heres a slightly adapted version of the db example for directory deletion :



the only change to it is I alterd the path of the dir from "mydir" to "C:\mydir" to make it easier to locate.

could you try this for me :

run the code, and with out closing DB, ( minimise it ), see if the directory is still on c drive, and can you delete it in windows ?

is there a bug in the comand ?
or is it just my pc ?

Benjamin
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 16th Mar 2003 21:04
you have to delete a directory using the C:\ thing too like "C:\testFolder"

xxxpetratxxx
B. R. W
simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Mar 2003 21:16
ok here is the snippet of my code :


the same format works fine for make directory, as the directory to be deleted would be :
C:\Dbrecent\test
where the set dir takes me to C:\dbrecent, and recentfile$(fileselect) is defined in the GET_RECENT_FILES subroutine, which outputs a filename string.

I just dont know why the command ( delete dir ) deletes the files ONLY, but not the dir ?

simonuk74
23
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Mar 2003 21:21
the code doesnt come up with an error, telling me that the file/directory isnt there, which proves that I`m in the correct directory, because the path I specfiy exists, but it still exists AFTER I have deleted it.

Does anybody know of a bug with this ?

indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 17th Mar 2003 04:42
this source works in DBC 113 and in the latest patch of DBP

I started with the example but didnt have to change anything to get it to work



Login to post a reply

Server time is: 2026-06-11 21:22:06
Your offset time is: 2026-06-11 21:22:06