Rick Posted April 4, 2013 Share Posted April 4, 2013 Following: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/filesystem/filesystemreadfile-r647 In Lua I have the following line: local stream = FileSystem:OpenFile(path) and I get the following error: Attempt to index global 'FileSystem' (a nil value) I need this to track high score for my game. Thanks. Link to comment Share on other sites More sharing options...
Josh Posted April 4, 2013 Share Posted April 4, 2013 Fixed for the next build. Lua has its own file IO commands as well, if you need something to test with. Note that the "writable" directory differs on each platform. You can't write files to an app's directory on iOS, Android, or technically on Windows if UAC is enabled. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted April 4, 2013 Author Share Posted April 4, 2013 So as of right now, LE doesn't have a cross-platform way to read/write data to disk? If not then I'll just remove the high score tracking I think, but having this cross-platform ability would be a big benefit and almost required I think. Do you know if I'd be able to figure out what directory I could write these files to disk based on platform? Link to comment Share on other sites More sharing options...
Josh Posted April 4, 2013 Share Posted April 4, 2013 I know there is one, it's different for each platform, and the Microsoft isn't forthcoming with that info. I think with Android it's this (in Java, of course): Context.getApplicationInfo().dataDir iOS: http://ramilcano.wor...appdirectories/ Windows: http://answers.microsoft.com/en-us/windows/forum/windows_7-performance/where-can-i-find-application-data-folders-in/26f4d163-7340-4974-b513-72bfcd1f54a5 Mac: http://stackoverflow.com/questions/9495503/applications-data-folder-in-mac I realized a while back the reason most operating systems are so hard to work with and get information for, is because the OS vendor views software developers as their competition. Microsoft wants to be the only software developer for Windows, and they only open it up to third parties as a business advantage. They make it hard to work with because then their competition has to waste time complying with all their silly designs, and it gives MS a big advantage. (Same is true of iOS. Android is just pure bad design.) The irony is that with Windows RT, they're finally getting their wish. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Admin Posted April 8, 2013 Share Posted April 8, 2013 Original report resolved. Link to comment Share on other sites More sharing options...
Recommended Posts