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 / I cannot find the text file in this project entitled 'Read from file'

Author
Message
Mark Garrett
Reviewed AGK on Steam
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 16th Jul 2017 17:44 Edited at: 16th Jul 2017 17:56
This program runs pretty good, but when I open the project folder, there is no text file. So I put my own text file entitled "myfile.txt" in the media folder.
But when I open it up to read it, it is blank. So, maybe the text file is somewhere else? Or maybe I'm supposed to save it first, or (confused) .. where could I find the text file?

{ link- Agk projects/Files/Reading from files }

.

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 16th Jul 2017 18:06
write goes in appdata folder
AGK (Steam) V2017.05.15 : Windows 10 Pro 64 Bit : AMD (17.4.4) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Mark Garrett
Reviewed AGK on Steam
19
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 16th Jul 2017 19:39 Edited at: 16th Jul 2017 20:19
Where is the 'appdata folder'

Oh, I found it. Gee, is different then DBpro. In DPpro it was in the media folder all the time. After all, a text file is 'media' isn't it?

Had to alter my folder specs from the Control panel and change the configuration of my PC just to find it, as it is a 'hidden' folder.

Why does it put it out of sight in the 'appdata folder'? Is good to have access to it . Is useful for checking the program to see if it's really reading/ writing to the text file like I think it is.
.
GameDevGuy
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 16th Jul 2017 22:23
I think the reason for storing stuff in the AppData folder is that it keeps the file operations consistent with the mobile platform. On Android and iOS there is a special data folder which you and the app/program has little (no?) control over.

Even if that is the logical reason (from a cross-platform "let's keep everything as similar as possible" viewpoint) for the use of AppData on Windows, it still doesn't make it any less annoying if you only develop for the desktop OS's or are used to more flexibility and freedom.
AjiMundi
9
Years of Service
User Offline
Joined: 28th Sep 2015
Location:
Posted: 17th Jul 2017 04:05
Well, with a few lnes of code, you can make your Windows based program to write on its own folder. I see no problem here.
Of course you have to be mindful of where the program is installed/copied, since under Windows, there are restrictions on where you can write, which is why it's easier to have it use AGK's default AppData folder in the first place. That is, unless you expect all users to be savvy enough to know where to install or have them disable UAC.
GameDevGuy
9
Years of Service
User Offline
Joined: 18th Jul 2015
Location:
Posted: 17th Jul 2017 08:48
Sure with the run-time in a finished application use AppData for the reasons you suggest, because not everywhere is writeable.

But during development, if I put files into a Media folder that is one level down from my source code which is in the Windows My Documents (or similar) folder, my gut feeling is that during development and testing that should be the folder that is written to.

As the original post suggests, it can be confusing, and I bet it trips up a lot of AppGameKit users. It is not a problem, just annoying, and tricky until you realize what is going on.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Jul 2017 11:12
see GetDocumentsPath ()
https://www.appgamekit.com/documentation/Reference/File/GetDocumentsPath.htm
AGK (Steam) V2017.05.15 : Windows 10 Pro 64 Bit : AMD (17.4.4) Radeon R7 265 : Mac mini OS Sierra (10.12.2)

Login to post a reply

Server time is: 2024-11-24 12:12:48
Your offset time is: 2024-11-24 12:12:48