From b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0 Mon Sep 17 00:00:00 2001
From: carregal
Date: Mon, 11 Feb 2008 22:42:21 +0000
Subject: Preparing the 1.4.0 release. Added documentation for lfs.setmode
---
Makefile | 4 ++--
Makefile.win | 4 ++--
README | 8 ++++++--
doc/us/index.html | 25 ++++++++++++++++++-------
doc/us/license.html | 4 ++--
doc/us/manual.html | 22 +++++++++++++++-------
src/lfs.c | 14 ++++++++------
src/lfs.def | 10 +++++-----
src/lfs.h | 32 ++++++++++++++++----------------
9 files changed, 74 insertions(+), 49 deletions(-)
diff --git a/Makefile b/Makefile
index c9bf206..f6b8d26 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
-# $Id: Makefile,v 1.31 2008/01/23 02:48:47 mascarenhas Exp $
+# $Id: Makefile,v 1.32 2008/02/11 22:42:21 carregal Exp $
T= lfs
-V= 1.3.0
+V= 1.4.0
CONFIG= ./config
include $(CONFIG)
diff --git a/Makefile.win b/Makefile.win
index 1fcd921..bc37183 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -1,7 +1,7 @@
-# $Id: Makefile.win,v 1.8 2008/01/23 02:50:08 mascarenhas Exp $
+# $Id: Makefile.win,v 1.9 2008/02/11 22:42:21 carregal Exp $
T= lfs
-V= 1.3.0
+V= 1.4.0
include config.win
diff --git a/README b/README
index 23fa331..0ccb3f0 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
LuaFileSystem - File System Library for Lua
-Copyright 2003-2007 Kepler Project
+Copyright 2003 Kepler Project
http://www.keplerproject.org/luafilesystem
Description
@@ -10,7 +10,11 @@ related to file systems offered by the standard Lua distribution.
LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.
LuaFileSystem is free software and uses the same license as Lua 5.1
-Current version is 1.3.0
+Current version is 1.4.0
+
+LuaRocks Installation
+---------------------
+luarocks install lfs
Unix Installation
-----------------
diff --git a/doc/us/index.html b/doc/us/index.html
index e8da278..0283cc0 100644
--- a/doc/us/index.html
+++ b/doc/us/index.html
@@ -71,20 +71,31 @@ the underlying directory structure and file attributes.
Current version is 1.3.0. It was developed for Lua 5.1.
+Current version is 1.4.0. It was developed for Lua 5.1.
- - Version 1.3.0 [26/Oct/2007]
+ - Version 1.4.0 [12/Feb/2008]
+ -
+
+ lfs.attributes
+ raises an error if attribute does not exist
+ - added function
+
lfs.setmode
+ (works only in non Windows systems).
+
+
+
+ - Version 1.3.0 [26/Oct/2007]
-
- added function
@@ -107,14 +118,14 @@ version of LuaFileSystem can be found at the same LuaForge page.
lfs.attributes
- added function
lfs.rmdir
- - bug correction on
lfs.dir
+ - bug correction on
lfs.dir
- Version 1.1 [30/May/2005]
-
- - added function
lfs.touch.
+ - added function
lfs.touch.
@@ -147,7 +158,7 @@ Comments are welcome!
Valid XHTML 1.0!
-
$Id: index.html,v 1.38 2007/12/14 15:28:04 carregal Exp $
+
$Id: index.html,v 1.39 2008/02/11 22:42:21 carregal Exp $
diff --git a/doc/us/license.html b/doc/us/license.html
index 14feb79..4ecad4b 100644
--- a/doc/us/license.html
+++ b/doc/us/license.html
@@ -85,7 +85,7 @@ Ierusalimschy, André Carregal and Tomás Guisasola.
The implementation is not derived from licensed software.
-Copyright © 2004-2007 Kepler Project.
+Copyright © 2003 Kepler Project.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -113,7 +113,7 @@ SOFTWARE.
Valid XHTML 1.0!
-
$Id: license.html,v 1.12 2007/12/14 15:28:04 carregal Exp $
+
$Id: license.html,v 1.13 2008/02/11 22:42:21 carregal Exp $
diff --git a/doc/us/manual.html b/doc/us/manual.html
index 32bdb92..762464d 100644
--- a/doc/us/manual.html
+++ b/doc/us/manual.html
@@ -74,7 +74,7 @@ and header files for the target version must be installed properly.
LuaFileSystem offers a Makefile and a separate configuration file,
config,
-which should be edited to suit your installation before runnig
+which should be edited to suit your installation before running
make.
The file has some definitions like paths to the external libraries,
compiler options and the like.
@@ -82,12 +82,14 @@ compiler options and the like.
Installation
-The LuaFileSystem compiled binary should be copied to a directory in your
-C path.
+The easiest way to install LuaFileSystem is to use LuaRocks:
+
+
+luarocks install lfs
+
-Windows users can use the binary version of LuaFileSystem
-(lfs.dll) available at
-LuaForge.
+If you prefer to install LuaFileSystem manually, the compiled binary should be copied to a directory in your
+C path.
Reference
@@ -202,6 +204,12 @@ LuaFileSystem offers the following functions:
- Removes an existing directory. The argument is the name of the directory.
Returns true if the operation was successful;
in case of error, it returns nil plus an error string.
+
+ lfs.setmode (filepath, mode)
+ - Sets the writing mode for a file. The mode string can be either
binary or text.
+ Returns the previous mode string for the file. This function is only available in Windows, so you may want to make sure that
+ lfs.setmode exists before using it.
+
lfs.symlinkattributes (filepath [, aname])
- Identical to lfs.attributes except that
@@ -240,7 +248,7 @@ LuaFileSystem offers the following functions:
Valid XHTML 1.0!
-
$Id: manual.html,v 1.38 2007/12/14 15:28:04 carregal Exp $
+
$Id: manual.html,v 1.39 2008/02/11 22:42:21 carregal Exp $
diff --git a/src/lfs.c b/src/lfs.c
index f52fecc..a4dd830 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -1,6 +1,6 @@
/*
** LuaFileSystem
-** Copyright Kepler Project 2004-2007 (http://www.keplerproject.org/luafilesystem)
+** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
**
** File system manipulation library.
** This library offers these functions:
@@ -11,11 +11,12 @@
** lfs.lock (fh, mode)
** lfs.mkdir (path)
** lfs.rmdir (path)
+** lfs.setmode (filepath, mode)
** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts
** lfs.touch (filepath [, atime [, mtime]])
** lfs.unlock (fh)
**
-** $Id: lfs.c,v 1.46 2008/01/25 17:09:56 mascarenhas Exp $
+** $Id: lfs.c,v 1.47 2008/02/11 22:42:21 carregal Exp $
*/
#include
@@ -75,7 +76,7 @@ typedef struct dir_data {
#define _O_TEXT 0
#define _O_BINARY 0
#define lfs_setmode(L,file,m) ((void)((void)file,m), \
- luaL_error(L, LUA_QL("setmode") " not supported"), -1)
+ luaL_error(L, LUA_QL("setmode") " not supported on non Windows platforms"), -1)
#endif
/*
@@ -619,13 +620,13 @@ static int link_info (lua_State *L) {
*/
static void set_info (lua_State *L) {
lua_pushliteral (L, "_COPYRIGHT");
- lua_pushliteral (L, "Copyright (C) 2003-2007 Kepler Project");
+ lua_pushliteral (L, "Copyright (C) 2003 Kepler Project");
lua_settable (L, -3);
lua_pushliteral (L, "_DESCRIPTION");
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");
lua_settable (L, -3);
lua_pushliteral (L, "_VERSION");
- lua_pushliteral (L, "LuaFileSystem 1.3.0");
+ lua_pushliteral (L, "LuaFileSystem 1.4.0");
lua_settable (L, -3);
}
@@ -636,11 +637,12 @@ static const struct luaL_reg fslib[] = {
{"currentdir", get_dir},
{"dir", dir_iter_factory},
{"lock", file_lock},
- {"setmode", lfs_f_setmode},
{"mkdir", make_dir},
{"rmdir", remove_dir},
#ifndef _WIN32
{"symlinkattributes", link_info},
+#else
+ {"setmode", lfs_f_setmode},
#endif
{"touch", file_utime},
{"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 @@
-LIBRARY lfs.dll
-DESCRIPTION "LuaFileSystem"
-VERSION 1.2.1
-EXPORTS
-luaopen_lfs
+LIBRARY lfs.dll
+DESCRIPTION "LuaFileSystem"
+VERSION 1.4.0
+EXPORTS
+luaopen_lfs
diff --git a/src/lfs.h b/src/lfs.h
index 62ae79f..05a9571 100644
--- a/src/lfs.h
+++ b/src/lfs.h
@@ -1,16 +1,16 @@
-/*
-** LuaFileSystem
-** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/luafilesystem)
-**
-** $Id: lfs.h,v 1.3 2006/03/10 23:37:32 carregal Exp $
-*/
-
-/* Define 'chdir' for systems that do not implement it */
-#ifdef NO_CHDIR
-#define chdir(p) (-1)
-#define chdir_error "Function 'chdir' not provided by system"
-#else
-#define chdir_error strerror(errno)
-#endif
-
-int luaopen_lfs (lua_State *L);
+/*
+** LuaFileSystem
+** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
+**
+** $Id: lfs.h,v 1.4 2008/02/11 22:42:21 carregal Exp $
+*/
+
+/* Define 'chdir' for systems that do not implement it */
+#ifdef NO_CHDIR
+#define chdir(p) (-1)
+#define chdir_error "Function 'chdir' not provided by system"
+#else
+#define chdir_error strerror(errno)
+#endif
+
+int luaopen_lfs (lua_State *L);
--
cgit v1.2.3-55-g6feb