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 Professional Discussion / Finding the Directory Path of a file

Author
Message
LiamBradbury
15
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 23rd Feb 2014 05:24
This is probably really easy but how would I find the directory of a file?

I'm using bluegui which allows me to load a file but I need to know the directory that the file is in so that I can use "set dir", as far as I know "set dir" can't be set from a file path.

Any suggestions?

audiosparx.com/liambradburymusic - professional music for your games.
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 23rd Feb 2014 06:42
cd - you will need to strip the file name right of the right most forward slash, from the string returned from the openDialog.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Feb 2014 07:34
Never heard someone refer to it as the dictionary.



LiamBradbury
15
Years of Service
User Offline
Joined: 28th Apr 2011
Location: Manchester, UK
Posted: 23rd Feb 2014 21:29
Thanks guys!

audiosparx.com/liambradburymusic - professional music for your games.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Feb 2014 23:59
If you use my plug-ins, then you can do this a little more efficiently:


Login to post a reply

Server time is: 2026-07-06 07:51:25
Your offset time is: 2026-07-06 07:51:25