PUTFILE with SETCURRENTDIR on Win

Previous topic - Next topic

ampos

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)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Kitty Hello

putfile does not work anywhere except PLATFORMINFO$("DOCUMENTS") - might be different with jailbreak, I have no idea.

ampos

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?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Kitty Hello

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


ampos

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.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE