Created
July 16, 2012 10:00
-
-
Save shiweifu/3121887 to your computer and use it in GitHub Desktop.
load json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- author: shiweifu | |
-- mail: [email protected] | |
cjson = require("cjson") | |
function load_json_db( db_name ) | |
local f = io.open(db_name) | |
local s = f:read("*a") | |
f:close() | |
return cjson.decode(s) | |
end | |
function main() | |
local db = load_json_db("videos.db") | |
end | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment