SETCURRENTDIR ("MEDIA")
PUTFILE "tmb.ini",0,thing
GETFILE "tmb.ini",0,thing
On Win, Putfile writes in current app folder and getfile read from media folder.
(on iPhone, it read and writes in media folder)
putfile does not work anywhere except PLATFORMINFO$("DOCUMENTS") - might be different with jailbreak, I have no idea.
Ok, I will try on my non-JB iphone... but the file "tmb.ini" is on /media folder on the iPhone.
But notice that the bug is not on the iPhone but on Win: it ignores "setcurrentdir" in putfile.
Anyway, my Mac HD die last night while final compiling for appstore... :rant:
Will test later... when I fix/install MacOS... :rant: :rant: :rant: :rant: :rant: :rant: :rant:
Also, I dont full understand the PLATFORMINFO$("DOCUMENTS") thing.
Should I do
setcurrentdir (platforminfo$("documents"))
before any iphone save command?
I do this:
// ini not in documents? Copy from Media to there
IF NOT DOESFILEEXIST(platforminfo$("DOCUMENTS")+"/test.ini" )
COPYFILE "Media/test.ini", platforminfo$("DOCUMENTS")+"/test.ini"
ENDIF
// open the copy file to get write access
INIOPEN platforminfo$("DOCUMENTS")+"/test.ini"
// now read/write to ini file
Checked.
Jailbroken iphone (or at least iphone4+4.1) can write to /media dir. Unjailbroken one (3G+3.1.3) can not.
But the Win bug (putfile ignoring "setcurrentdir") is still there.