summaryrefslogtreecommitdiff
path: root/src/lib/elua
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-04-16 18:15:35 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-04-16 18:15:57 +0100
commit7a9fbd27abe2174df33a5e0e73f96ca4c8c0dec8 (patch)
treecde73719ee29f2d0aec4e975be66802116b372f8 /src/lib/elua
parent1c6f3fd966fb64ed0ea9601e8fea71779e743566 (diff)
elua: more file utilities in clib
Diffstat (limited to 'src/lib/elua')
-rw-r--r--src/lib/elua/elua.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/elua/elua.c b/src/lib/elua/elua.c
index 765b275965..606d04e45b 100644
--- a/src/lib/elua/elua.c
+++ b/src/lib/elua/elua.c
@@ -414,6 +414,34 @@ _elua_file_mkdir(lua_State *L)
414 return 1; 414 return 1;
415} 415}
416 416
417static int
418_elua_file_mkpath(lua_State *L)
419{
420 lua_pushboolean(L, ecore_file_mkpath(luaL_checkstring(L, 1)));
421 return 1;
422}
423
424static int
425_elua_file_rmdir(lua_State *L)
426{
427 lua_pushboolean(L, ecore_file_rmdir(luaL_checkstring(L, 1)));
428 return 1;
429}
430
431static int
432_elua_file_unlink(lua_State *L)
433{
434 lua_pushboolean(L, ecore_file_unlink(luaL_checkstring(L, 1)));
435 return 1;
436}
437
438static int
439_elua_file_rmrf(lua_State *L)
440{
441 lua_pushboolean(L, ecore_file_recursive_rm(luaL_checkstring(L, 1)));
442 return 1;
443}
444
417const luaL_reg _elua_cutillib[] = 445const luaL_reg _elua_cutillib[] =
418{ 446{
419 { "init_module", _elua_module_init }, 447 { "init_module", _elua_module_init },
@@ -421,6 +449,10 @@ const luaL_reg _elua_cutillib[] =
421 { "file_is_dir", _elua_file_is_dir }, 449 { "file_is_dir", _elua_file_is_dir },
422 { "file_exists", _elua_file_exists }, 450 { "file_exists", _elua_file_exists },
423 { "file_mkdir" , _elua_file_mkdir }, 451 { "file_mkdir" , _elua_file_mkdir },
452 { "file_mkpath", _elua_file_mkpath },
453 { "file_rmdir" , _elua_file_rmdir },
454 { "file_unlink", _elua_file_unlink },
455 { "file_rmrf" , _elua_file_rmrf },
424 { NULL , NULL } 456 { NULL , NULL }
425}; 457};
426 458