diff options
author | carregal <carregal> | 2008-02-11 22:42:21 +0000 |
---|---|---|
committer | carregal <carregal> | 2008-02-11 22:42:21 +0000 |
commit | b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0 (patch) | |
tree | 3821afea9fa46010f0047accff73e6bd85bf68af /src | |
parent | 78f28b64686390592792e2d5abba26c6f815d534 (diff) | |
download | luafilesystem-b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0.tar.gz luafilesystem-b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0.tar.bz2 luafilesystem-b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0.zip |
Preparing the 1.4.0 release.
Added documentation for lfs.setmode
Diffstat (limited to 'src')
-rw-r--r-- | src/lfs.c | 14 | ||||
-rw-r--r-- | src/lfs.def | 10 | ||||
-rw-r--r-- | src/lfs.h | 32 |
3 files changed, 29 insertions, 27 deletions
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | ** LuaFileSystem | 2 | ** LuaFileSystem |
3 | ** Copyright Kepler Project 2004-2007 (http://www.keplerproject.org/luafilesystem) | 3 | ** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem) |
4 | ** | 4 | ** |
5 | ** File system manipulation library. | 5 | ** File system manipulation library. |
6 | ** This library offers these functions: | 6 | ** This library offers these functions: |
@@ -11,11 +11,12 @@ | |||
11 | ** lfs.lock (fh, mode) | 11 | ** lfs.lock (fh, mode) |
12 | ** lfs.mkdir (path) | 12 | ** lfs.mkdir (path) |
13 | ** lfs.rmdir (path) | 13 | ** lfs.rmdir (path) |
14 | ** lfs.setmode (filepath, mode) | ||
14 | ** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts | 15 | ** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts |
15 | ** lfs.touch (filepath [, atime [, mtime]]) | 16 | ** lfs.touch (filepath [, atime [, mtime]]) |
16 | ** lfs.unlock (fh) | 17 | ** lfs.unlock (fh) |
17 | ** | 18 | ** |
18 | ** $Id: lfs.c,v 1.46 2008/01/25 17:09:56 mascarenhas Exp $ | 19 | ** $Id: lfs.c,v 1.47 2008/02/11 22:42:21 carregal Exp $ |
19 | */ | 20 | */ |
20 | 21 | ||
21 | #include <errno.h> | 22 | #include <errno.h> |
@@ -75,7 +76,7 @@ typedef struct dir_data { | |||
75 | #define _O_TEXT 0 | 76 | #define _O_TEXT 0 |
76 | #define _O_BINARY 0 | 77 | #define _O_BINARY 0 |
77 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ | 78 | #define lfs_setmode(L,file,m) ((void)((void)file,m), \ |
78 | luaL_error(L, LUA_QL("setmode") " not supported"), -1) | 79 | luaL_error(L, LUA_QL("setmode") " not supported on non Windows platforms"), -1) |
79 | #endif | 80 | #endif |
80 | 81 | ||
81 | /* | 82 | /* |
@@ -619,13 +620,13 @@ static int link_info (lua_State *L) { | |||
619 | */ | 620 | */ |
620 | static void set_info (lua_State *L) { | 621 | static void set_info (lua_State *L) { |
621 | lua_pushliteral (L, "_COPYRIGHT"); | 622 | lua_pushliteral (L, "_COPYRIGHT"); |
622 | lua_pushliteral (L, "Copyright (C) 2003-2007 Kepler Project"); | 623 | lua_pushliteral (L, "Copyright (C) 2003 Kepler Project"); |
623 | lua_settable (L, -3); | 624 | lua_settable (L, -3); |
624 | lua_pushliteral (L, "_DESCRIPTION"); | 625 | lua_pushliteral (L, "_DESCRIPTION"); |
625 | lua_pushliteral (L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution"); | 626 | lua_pushliteral (L, "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution"); |
626 | lua_settable (L, -3); | 627 | lua_settable (L, -3); |
627 | lua_pushliteral (L, "_VERSION"); | 628 | lua_pushliteral (L, "_VERSION"); |
628 | lua_pushliteral (L, "LuaFileSystem 1.3.0"); | 629 | lua_pushliteral (L, "LuaFileSystem 1.4.0"); |
629 | lua_settable (L, -3); | 630 | lua_settable (L, -3); |
630 | } | 631 | } |
631 | 632 | ||
@@ -636,11 +637,12 @@ static const struct luaL_reg fslib[] = { | |||
636 | {"currentdir", get_dir}, | 637 | {"currentdir", get_dir}, |
637 | {"dir", dir_iter_factory}, | 638 | {"dir", dir_iter_factory}, |
638 | {"lock", file_lock}, | 639 | {"lock", file_lock}, |
639 | {"setmode", lfs_f_setmode}, | ||
640 | {"mkdir", make_dir}, | 640 | {"mkdir", make_dir}, |
641 | {"rmdir", remove_dir}, | 641 | {"rmdir", remove_dir}, |
642 | #ifndef _WIN32 | 642 | #ifndef _WIN32 |
643 | {"symlinkattributes", link_info}, | 643 | {"symlinkattributes", link_info}, |
644 | #else | ||
645 | {"setmode", lfs_f_setmode}, | ||
644 | #endif | 646 | #endif |
645 | {"touch", file_utime}, | 647 | {"touch", file_utime}, |
646 | {"unlock", file_unlock}, | 648 | {"unlock", file_unlock}, |
diff --git a/src/lfs.def b/src/lfs.def index dfe5c59..a0483c7 100644 --- a/src/lfs.def +++ b/src/lfs.def | |||
@@ -1,5 +1,5 @@ | |||
1 | LIBRARY lfs.dll | 1 | LIBRARY lfs.dll |
2 | DESCRIPTION "LuaFileSystem" | 2 | DESCRIPTION "LuaFileSystem" |
3 | VERSION 1.2.1 | 3 | VERSION 1.4.0 |
4 | EXPORTS | 4 | EXPORTS |
5 | luaopen_lfs | 5 | luaopen_lfs |
@@ -1,16 +1,16 @@ | |||
1 | /* | 1 | /* |
2 | ** LuaFileSystem | 2 | ** LuaFileSystem |
3 | ** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/luafilesystem) | 3 | ** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem) |
4 | ** | 4 | ** |
5 | ** $Id: lfs.h,v 1.3 2006/03/10 23:37:32 carregal Exp $ | 5 | ** $Id: lfs.h,v 1.4 2008/02/11 22:42:21 carregal Exp $ |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* Define 'chdir' for systems that do not implement it */ | 8 | /* Define 'chdir' for systems that do not implement it */ |
9 | #ifdef NO_CHDIR | 9 | #ifdef NO_CHDIR |
10 | #define chdir(p) (-1) | 10 | #define chdir(p) (-1) |
11 | #define chdir_error "Function 'chdir' not provided by system" | 11 | #define chdir_error "Function 'chdir' not provided by system" |
12 | #else | 12 | #else |
13 | #define chdir_error strerror(errno) | 13 | #define chdir_error strerror(errno) |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | int luaopen_lfs (lua_State *L); | 16 | int luaopen_lfs (lua_State *L); |