android
  #1  
Old 01-29-2011, 08:20 AM
Nohajc's Avatar
Nohajc Nohajc is offline
Junior Member
 
Join Date: Mar 2010
Location: Czech Republic
Posts: 68
Default io.tmpfile()

Has anyone used this function on ZEN?
I tried to call it in my app and the player just froze...
Am I missing something important?
__________________
There was a little man...
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 01-29-2011, 09:12 AM
ZaPx64's Avatar
ZaPx64 ZaPx64 is offline
Member
 
Join Date: Nov 2009
Location: Germany
Posts: 136
Default

Remember io.tmpfile() returns a string of a file name you could write to, not the file handle itself.
__________________
Zen X-Fi2 Apps: Notee-fi (notepad) | TicTacToe | Mahjongg
http://www.starfare.eu/ - a free real-time strategy game.
Reply With Quote

  #3  
Old 01-29-2011, 09:36 AM
Nohajc's Avatar
Nohajc Nohajc is offline
Junior Member
 
Join Date: Mar 2010
Location: Czech Republic
Posts: 68
Default

Thanks for this piece of information.
If it really doesn't return fileobj, that means it's wrong at the wiki.
http://en.wikipedia.org/wiki/User:Th...2_Lua#IO_table

This got me confused.
__________________
There was a little man...
Reply With Quote

  #4  
Old 02-02-2011, 11:52 PM
ThievingSix ThievingSix is offline
Member
 
Join Date: Aug 2008
Posts: 218
Default

My School IP is banned from wiki because of Vandalism. I'll edit it when I get home.
__________________
Only ONE more functions in the Wiki need addressing!
Zen X-Fi2 LUA Wiki
Want to protect your applications? Click Here!
Tower Defense Thread
Zen Lock - Protect Your Zen!
Reply With Quote

  #5  
Old 02-03-2011, 04:19 AM
Nohajc's Avatar
Nohajc Nohajc is offline
Junior Member
 
Join Date: Mar 2010
Location: Czech Republic
Posts: 68
Default

I'm not sure you should edit it. I read about this function from different sources and they all claim it returns file handle, actually. Not a filename string. I think ZaPx64 may have been talking about os.tmpname(), which for me didn't work either (looks like the function doesn't even exist)...
__________________
There was a little man...
Reply With Quote

  #6  
Old 02-04-2011, 12:54 PM
ZaPx64's Avatar
ZaPx64 ZaPx64 is offline
Member
 
Join Date: Nov 2009
Location: Germany
Posts: 136
Default

Yes indeed, my bad
__________________
Zen X-Fi2 Apps: Notee-fi (notepad) | TicTacToe | Mahjongg
http://www.starfare.eu/ - a free real-time strategy game.
Reply With Quote

  #7  
Old 02-04-2011, 05:20 PM
Nohajc's Avatar
Nohajc Nohajc is offline
Junior Member
 
Join Date: Mar 2010
Location: Czech Republic
Posts: 68
Default

Well anyway, I was unable to use tmpfile with either of these methods.
Instead, I just created an empty file called swap to which I write or read from when I need to. Not so elegant but with the same effect.
__________________
There was a little man...
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:45 PM.