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 / Bug: SetFolder() does not create folder on Linux

Author
Message
Zigi
15
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 29th Jan 2016 13:49 Edited at: 29th Jan 2016 13:57
Hi.

Seems like SetFolder() unable to create (or may not even try to create) a folder in case it doesn't exists on Ubuntu 14.04 64bit.
I don't get any error message in terminal or debugger. I was trying to do the following:



In case the folder doesn't exists, SetFolder() does not create it and I don't get the image saved or any error message.
If I create the folder manually using MakeFolder() before SetFolder(), it works but on Windows I don't need to use MakeFolder(). If the folder does not exists, SetFolder() create that folder but not on Linux

Thank you.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 29th Jan 2016 17:14
Personally I'd check if the folder exists first, create it or set it depending on result. It's probably one of those platform dependent things so best to make your code as robust as you can.
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Zigi
15
Years of Service
User Offline
Joined: 5th Jul 2009
Location:
Posted: 29th Jan 2016 18:36 Edited at: 29th Jan 2016 18:46
I thought the same, but I can't find any commands in the documentation to check if a folder exists or not at currently used location
The only commands I can find is to get currently used folder, first folder, next folder and number of folders at currently used location.

I wonder if I could check the number of folders in root folder if it 1 (I have only the media folder) than I need to create the folder I need.
Or, I could try to set the folder to the one I need, and than check if the current folder is the one I need, if it not than probably it doesn't exists so I can create it and try to set it again.
Or I could create the folder anyway when the app running for the first time.
I don't know which would be better, should have a better way (a single command) to check if the folder I'm about to set is there or not but I can't find any command for that

SetFolder() check it by default and also create the folder in case it doesn't exists but only on Windows.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 29th Jan 2016 22:50 Edited at: 29th Jan 2016 22:51
I'm not sure if SetFolder() really should create a new folder. I know it's part of how the command works. But should that be altered? We have MakeFolder() after all. And I think it would make sense to have GetFolderExist().
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 30th Jan 2016 08:23
Quote: "GetFolderExist()"
+1
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 2nd Feb 2016 15:27
you need to add '/' to folder name. to check if folder exists use getFileExists().
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 2nd Feb 2016 15:38
Quote: "you need to add '/' to folder name. to check if folder exists use getFileExists()."
Nice tip! Thanks
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Scary Little Rabbit
15
Years of Service
User Offline
Joined: 4th Aug 2009
Location: Chelyabinsk, Russian Federation.
Posted: 3rd Feb 2016 06:08
CJB you are welcome. but anyway it should be improved or explained in guides.
error #1:
'too many stars, too many stares. disembody.'
WIP: MIND!! free fonts for your AGKs

Login to post a reply

Server time is: 2024-11-25 11:52:15
Your offset time is: 2024-11-25 11:52:15