So - I ran across this:
if not love.filesystem.exists("expo.png") then
local http = require("socket.http")
local b, c, h = http.request("http://love2d.org/w/images/e/e3/ResourceExplosion.png")
love.filesystem.write("expo.png", b)
end
In my case, it’s font data I’m hankerin to grab and store.
I think the analog with the published API (is this coming in the next update?) is:
fontdata = readLocalData("font", nil)
if not fontdata then
local http = require("socket.http")
local b, c, h = http.request("http://raw.github.com/bortels/HersheyCodea/master/romansimplex.dat")
fontdata = b
saveLocalData("font", fontdata)
end
Yes, no sockets yet (and presumably they won’t be a “require”, but that’s a placeholder) - but I wanted to publish something concrete as to what I’d like to do. Idea being, look in local store, and if the data needed isn’t there, go grab it and cache it for later use. (we can do this in safari/javascript today)
Why am I posting? Memory mostly - now I can forget about this, and I know where to look. Also to see if the data store is in the current waiting-to-be-approved app, and to provide a sample use case. In my case, the font data is binary-safe, but this is why I was asking before if the store would be able to hold arbitrary binary data; I could see doing the same thing with a png and wanting to store it, and that’s not 8-bit-clean (and having to based64 encode it would be a kludge).