Author Topic: PUTFILE with SETCURRENTDIR on Win  (Read 1716 times)

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
PUTFILE with SETCURRENTDIR on Win
« 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)
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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10816
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: PUTFILE with SETCURRENTDIR on Win
« Reply #1 on: 2010-Nov-17 »
putfile does not work anywhere except PLATFORMINFO$("DOCUMENTS") - might be different with jailbreak, I have no idea.

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
Re: PUTFILE with SETCURRENTDIR on Win
« Reply #2 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?
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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10816
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: PUTFILE with SETCURRENTDIR on Win
« Reply #3 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

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1600
    • View Profile
    • AMpostata Website
Re: PUTFILE with SETCURRENTDIR on Win
« Reply #4 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.
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