Posted: 4th Dec 2011 17:02
Hi all,
I'm using tier 1 version 1.065 and trying to get the files in a folder using SetCurrentDir(), GetFirstFile, GetNextFile, etc. but I only get and empty string. In another post, I've read that GetCurrentDir() has a problem...
Has anybody get to make these functions work?

Thanks in advance.
Oscar
Posted: 4th Dec 2011 21:39
Hi there. I had some trouble with these too. One thing I found what that if I used the OpenToWrite command before using them, I was able to access files in the storage area created by AppGameKit for files created by your program. It depends on what you are trying to achieve though. I don't think you can use these files outside of the media directory and the directory used by the other file commands. Hopefully someone will be able to explain better exactly how these are meant to work though.
Posted: 5th Dec 2011 6:12
Thanks, Lucas, I'll try use OpenToWrite before File functions to see if it works for me.
I'm only trying to get which files are in the app root folder, so maybe your method works.
Posted: 5th Dec 2011 11:11
You can only access a specific folder through AGK. And it is not your root folder. On PC the folder is created in "My Documents/AGK" and on Android Player it is in "My Files/AGK".
Posted: 5th Dec 2011 17:36
I just had the same issue.

I even tried to check the directory was set right using GetCurrentDir() only to find it's not recognised as a command. I've submitted this to the bug list.

I can confirm that using OpentoWrite ( "Dummy.txt" ) does seem kick it into life, but strangely (and contrary to all documentation and advice) it now returns a list of files from the project root (see attached).

Edit:

It wrote the "dummy.txt" file to "my documents/agk/ { sub folder for the project }.

The file list returned is a combination of this folder and the project root - as demonstrated by the presence of the source files.

Weirdest of all, since this, I have removed the opentowrite() command, and it still returns the list of files.
Posted: 8th Dec 2011 0:38
We've received the hint that you want full control of directories when your app is on Windows and Mac, so build 107 will address this. Seems you guys are creating level editors, export tools and all manner of apps that require files to be placed all over the place. The original idea was to completely sand-box file access in AppGameKit, but the price is too high when you consider the inconvenience when writing tools. The ability to write and read to absolute paths however will be restricted to Windows and Mac, allowing mobile devices to be protected (and pass the various validation criteria of app stores).
Posted: 8th Dec 2011 9:58
Obviously the file access flexibility only makes sense on Windows and Mac.

Please remove (at least from from T2) the AppGameKit directory creation under Documents. It's creating a lot of problems on systems with no admin rights.
Posted: 9th Dec 2011 0:18
Where do you suggest we place writeable AppGameKit files? Anyone have any views on this?
Posted: 9th Dec 2011 11:49
On Windows and Mac place the files where the EXE is. If we want to place them in MyDocuments, we can use that path at our own will.

In my case, in Windows, I am supplying the standard 11 AppGameKit files for joystick, buttons and fonts (arial.png avenir.png button.png buttondown.png missing.png joystickinner.png joystickouter.png interpreter-backdrop.png interpreter-logo.png interpreter-power.png interpreter-spinner.png), yet AppGameKit still creates an empty AppGameKit directory under My Documents, even if it has to write nothing in it (as I am supplying the 11 files with my exe).

In the case of T2 iOS, AppGameKit writes nothing and creates no AppGameKit directory, as far as I know, (write files are placed under DOCUMENTS but that is standard IOS) so why does this happen on Windows?

I can understand the need to write those 11 files for T1, but in T2 there is no interpreter and many of those files are useless and taking space, as they are embedded in the main exe.
Posted: 10th Dec 2011 0:06
You could possibly have a 2nd media folder called something like "writemedia" or "rwmedia" alongside the media folder.

This would help identify which files were written by the running app during debugging and such.

It would keep them close to the source, yet separate from the distributed files in the current media folder.

Just my 2c
Posted: 12th Dec 2011 15:11
I personally don't see why AppGameKit has to include the default images if the commands are never used. It is a waste of space, and looks stupid.
Posted: 21st Dec 2011 16:36
Lots of good feedback here. Can someone post the essential requests to the issues board () so they are recorded for the development team. The bit about removing the player assets and the write folder options are particularly interesting.