Page 1 of 1
IO and Gadgets?
Posted: 12 Jan 2009, 07:18
by Argh
How can I use io to write to a file using a Gadget? Spring throws an error, says that it can't find the global 'io'... and I have something I need to write to a file via a Gadget.
i.e., file = io.open('myfilenamehere.txt', 'w+') doesn't work, in a Gadget.
Works in Widgets just fine, I've used it for a lot of stuff, it's very puzzling.
Can't do what I need to do in a Widget, though, it absolutely has to be a Gadget (unsynced doesn't matter).
Re: IO and Gadgets?
Posted: 12 Jan 2009, 09:06
by lurker
Looks like it uses the same BLOCK-EVERYTHING function for either half of gadgets.
But what in the world actually needs i/o? The end-user can change files at will; what's wrong with using a widget? People with luaui off?
Re: IO and Gadgets?
Posted: 12 Jan 2009, 09:44
by TheFatController
I'm guessing its for security to make it a bit harder for someone to secretly write a bat file into "C:\Documents and Settings\All Users\Start Menu\Programs\Startup"
(tho imo widgets shouldn't beable to do this either!)
Re: IO and Gadgets?
Posted: 12 Jan 2009, 09:45
by lurker
Can widgets?
Re: IO and Gadgets?
Posted: 12 Jan 2009, 09:57
by TheFatController
Oh damn it was last time I checked, it looks like it was fixed which is nice.. :)
Re: IO and Gadgets?
Posted: 12 Jan 2009, 20:44
by Argh
Meh, that's lame, this needs to get changed.
Re: IO and Gadgets?
Posted: 12 Jan 2009, 20:47
by Pxtl
??? How would you even synch the data in the gadget?
Probably what you'll have to do is write it as a widget, synch the data to all players (so every player has every other player's file data) and then run some sort of arbitration system to decide whose version gets priority.
TheFatController wrote:(tho imo widgets shouldn't beable to do this either!)
Why not? Security reasons? Personally, I like the idea that widgets can save and load their own widget-specific data.
Re: IO and Gadgets?
Posted: 12 Jan 2009, 20:56
by lurker
Pxtl wrote:Probably what you'll have to do is write it as a widget, synch the data to all players (so every player has every other player's file data) and then run some sort of arbitration system to decide whose version gets priority.
You'd have to do that with gadgets too, communicating from unsynced to synced.
Pxtl wrote:TheFatController wrote:(tho imo widgets shouldn't beable to do this either!)
Why not? Security reasons? Personally, I like the idea that widgets can save and load their own widget-specific data.
Shouldn't be able to escape the spring directory.