diff options
author | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2016-04-16 18:15:35 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@osg.samsung.com> | 2016-04-16 18:15:57 +0100 |
commit | 7a9fbd27abe2174df33a5e0e73f96ca4c8c0dec8 (patch) | |
tree | cde73719ee29f2d0aec4e975be66802116b372f8 /src | |
parent | 1c6f3fd966fb64ed0ea9601e8fea71779e743566 (diff) |
elua: more file utilities in clib
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/elua/elua.c | 32 |
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 | ||
417 | static 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 | |||
424 | static 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 | |||
431 | static 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 | |||
438 | static 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 | |||
417 | const luaL_reg _elua_cutillib[] = | 445 | const 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 | ||