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 / Deleting whole Directories?

Author
Message
Holden
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location:
Posted: 16th Dec 2002 17:09
Hi there,

I wonderd if it's possible to delete all files of a directory? I searched the help file and found out that it's possible to delete single files using

Delete File "xxxx\xxxxx.xxx"

but that

Delete File "xxxx\*.*"

doesn't work. Maybe someone knows and can help me.

Thanks in advance,
so long!
Holden
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location:
Posted: 16th Dec 2002 17:26
Ok, tried Delete Directory instead and everything worked as supposed.

Holden
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location:
Posted: 16th Dec 2002 17:35
But still I'm interessted if and how I can find all files of one type (e.g. mp3s) (I want all of them to be copied in another directory which I can specify).

simonuk74
21
Years of Service
User Offline
Joined: 3rd Nov 2002
Location:
Posted: 16th Dec 2002 19:24
I`m not sure if theres an easier way than this...
I did a perform checklist for files in a directory, then used get file type to separate the files form the dir`s
Then copied the files names strings into an array, using checklist string().

then I just looked at the last 3 letters of the string, using right$(file$,3), if that was = to "MP3", then there you go..
I`m working on how to easily make file associations for all file types, but so far it looks like use the above method for each know file type.

I asked a question a little whail ago, and so far I have had no reply.. I wonder if you or anyone can help?
Is there a way of determining the file attributes ie, read only, archive, hidden ? as in my code, I`d rather not have to show hidden file types if possible.

simon

Holden
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location:
Posted: 17th Dec 2002 03:06
sorry- I'm just starting with programming and cannot figure out easy ways at all- honestly, I'm glad about_any_way that comes up with the result I'm looking for.

Login to post a reply

Server time is: 2024-03-02 17:52:11
Your offset time is: 2024-03-02 17:52:11