fix resource load

This commit is contained in:
Xuan Sang LE
2018-01-31 19:20:42 +01:00
parent 69849db99a
commit f5ff434152
6 changed files with 34 additions and 29 deletions

View File

@ -1,4 +1,6 @@
self.OS.API.handler =
get: "lua-api/fs/get"
scandir: (p, c ) ->
path = "lua-api/fs/scandir"
_API.post path, { path: p }, c, (e, s) ->
@ -13,11 +15,11 @@ self.OS.API.handler =
_API.post path, { path: p }, c, (e, s) ->
_courrier.osfail "Fail to get file metadata: #{p}", e, s
readfile: (p, c) ->
readfile: (p, c, t) ->
path = "lua-api/fs/get/"
_API.get path + p, c, (e, s) ->
_courrier.osfail "Fail to read file: #{p}", e, s
, "text"
, t
move: (s, d, c) ->
path = "lua-api/fs/move"