I try to create a folder use lfs in app,but the new folder not exist in system...
my test code
require "lfs"
lfs.mkdir("|D|cache/test")
print(result,err) |
out:
nil No such file or directory
lfs.c
static int make_dir (lua_State *L) {
const char *path = luaL_checkstring (L, 1);
int fail;
#ifdef _WIN32
fail = _mkdir (gpath_transform(path));
#else
fail = mkdir (gpath_transform(path), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH );
#endif
if (fail) {
lua_pushnil (L);
lua_pushfstring (L, "%s", strerror(errno));
return 2;
}
lua_pushboolean (L, 1);
return 1;
} |
Comments
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
do you have create each branch of the tree separately? No.
I found this problem,so I separate directory and mkdir folder hierarchy.