GLBasic forum

Main forum => Bug Reports => Topic started by: ampos on 2010-Nov-17

Title: PUTFILE with SETCURRENTDIR on Win
Post by: ampos on 2010-Nov-17
Code (glbasic) Select
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)
Title: Re: PUTFILE with SETCURRENTDIR on Win
Post by: Kitty Hello on 2010-Nov-17
putfile does not work anywhere except PLATFORMINFO$("DOCUMENTS") - might be different with jailbreak, I have no idea.
Title: Re: PUTFILE with SETCURRENTDIR on Win
Post by: ampos on 2010-Nov-17
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

Code (glbasic) Select
setcurrentdir (platforminfo$("documents"))

before any iphone save command?
Title: Re: PUTFILE with SETCURRENTDIR on Win
Post by: Kitty Hello on 2010-Nov-17
I do this:
Code (glbasic) Select

// 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

Title: Re: PUTFILE with SETCURRENTDIR on Win
Post by: ampos on 2010-Nov-18
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.