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.

AppGameKit Classic Chat / oddly... there does not seam to be a command to see if a path exists?

Author
Message
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 10th Jun 2016 14:23
is it safe to just call a command to create a directory if we are unable to test and see if it exists first?
maybe we should get a command to test if a path exists.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Jun 2016 15:35
The safest way is to OpenToWrite().
This will create the folder structure you have specified in the file name if it doesn't already exist.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 10th Jun 2016 22:39
thanks.... secondly..

i just noticed that makefolder("my new folder") does not actually make a new folder unless you decide to write something to it. Now this was just tested with this code here:



with this code on windows... no folder is made unless....

i do this:


now the folder has been created... odd.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Jun 2016 07:30
It was creating the file that created the folder. MakeFolder() had nothing to do with this.
Did it create the folder in your AGKapps standard write path?
I think you have your first SetRawWritePath() and SetFolder() lines back to front.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 11th Jun 2016 09:46
Quote: "This command returns 1 on success or 0 if you use an invalid path such as SetFolder("C:\"). "


I don't know if SetRawWritePath() can also return this. It would make sense that it does. It's worth trying out.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Jun 2016 09:27
It's 'sew' annoying when you can't find the correct command...

Login to post a reply

Server time is: 2024-09-29 15:22:52
Your offset time is: 2024-09-29 15:22:52