Preparing the 1.4.0 release.

Added documentation for lfs.setmode
This commit is contained in:
carregal
2008-02-11 22:42:21 +00:00
parent 78f28b6468
commit b66ab2cae9
9 changed files with 74 additions and 49 deletions

View File

@@ -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 T= lfs
V= 1.3.0 V= 1.4.0
CONFIG= ./config CONFIG= ./config
include $(CONFIG) include $(CONFIG)

View File

@@ -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 T= lfs
V= 1.3.0 V= 1.4.0
include config.win include config.win

8
README
View File

@@ -1,5 +1,5 @@
LuaFileSystem - File System Library for Lua LuaFileSystem - File System Library for Lua
Copyright 2003-2007 Kepler Project Copyright 2003 Kepler Project
http://www.keplerproject.org/luafilesystem http://www.keplerproject.org/luafilesystem
Description 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 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 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 Unix Installation
----------------- -----------------

View File

@@ -71,20 +71,31 @@ the underlying directory structure and file attributes.</p>
<h2><a name="status"></a>Status</h2> <h2><a name="status"></a>Status</h2>
<p>Current version is 1.3.0. It was developed for Lua 5.1.</p> <p>Current version is 1.4.0. It was developed for Lua 5.1.</p>
<h2><a name="download"></a>Download</h2> <h2><a name="download"></a>Download</h2>
<p>LuaFileSystem source can be downloaded from its <p>LuaFileSystem source can be downloaded from its
<a href="http://luaforge.net/projects/luafilesystem/files">Lua Forge</a> <a href="http://luaforge.net/projects/luafilesystem/files">Lua Forge</a>
page. If you are using page. If you are using
<a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.2 a Windows binary <a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.3 a Windows binary
version of LuaFileSystem can be found at the same LuaForge page.</p> version of LuaFileSystem (compiled with Visual Studio 2005 Express) can be found at the same LuaForge page.</p>
<h2><a name="history"></a>History</h2> <h2><a name="history"></a>History</h2>
<dl class="history"> <dl class="history">
<dt><strong>Version 1.3.0</strong> [26/Oct/2007]</dt> <dt><strong>Version 1.4.0</strong> [12/Feb/2008]</dt>
<dd>
<ul>
<li><a href="manual.html#attributes"><code>lfs.attributes</code></a>
raises an error if attribute does not exist</li>
<li>added function
<a href="manual.html#setmode"><code>lfs.setmode</code></a>
(works only in non Windows systems).</li>
</ul>
</dd>
<dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.3/">Version 1.3.0</a></strong> [26/Oct/2007]</dt>
<dd> <dd>
<ul> <ul>
<li>added function <li>added function
@@ -107,14 +118,14 @@ version of LuaFileSystem can be found at the same LuaForge page.</p>
<a href="manual.html#attributes"><code>lfs.attributes</code></a></li> <a href="manual.html#attributes"><code>lfs.attributes</code></a></li>
<li>added function <li>added function
<a href="manual.html#rmdir"><code>lfs.rmdir</code></a></li> <a href="manual.html#rmdir"><code>lfs.rmdir</code></a></li>
<li>bug correction on <code>lfs.dir</code></li> <li>bug correction on <a href="manual.html#dir"><code>lfs.dir</code></a></li>
</ul> </ul>
</dd> </dd>
<dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.1/">Version 1.1</a></strong> [30/May/2005]</dt> <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.1/">Version 1.1</a></strong> [30/May/2005]</dt>
<dd> <dd>
<ul> <ul>
<li>added function <code>lfs.touch</code>.</li> <li>added function <a href="manual.html#touch"><code>lfs.touch</code></a>.</li>
</ul> </ul>
</dd> </dd>
@@ -147,7 +158,7 @@ Comments are welcome!</p>
<div id="about"> <div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
<p><small>$Id: index.html,v 1.38 2007/12/14 15:28:04 carregal Exp $</small></p> <p><small>$Id: index.html,v 1.39 2008/02/11 22:42:21 carregal Exp $</small></p>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->

View File

@@ -85,7 +85,7 @@ Ierusalimschy, Andr&eacute; Carregal and Tom&aacute;s Guisasola.
The implementation is not derived from licensed software.</p> The implementation is not derived from licensed software.</p>
<hr/> <hr/>
<p>Copyright &copy; 2004-2007 Kepler Project.</p> <p>Copyright &copy; 2003 Kepler Project.</p>
<p>Permission is hereby granted, free of charge, to any person <p>Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
@@ -113,7 +113,7 @@ SOFTWARE.</p>
<div id="about"> <div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
<p><small>$Id: license.html,v 1.12 2007/12/14 15:28:04 carregal Exp $</small></p> <p><small>$Id: license.html,v 1.13 2008/02/11 22:42:21 carregal Exp $</small></p>
</div><!-- id="about" --> </div><!-- id="about" -->
</div><!-- id="container" --> </div><!-- id="container" -->

View File

@@ -74,7 +74,7 @@ and header files for the target version must be installed properly.
<p> <p>
LuaFileSystem offers a Makefile and a separate configuration file, LuaFileSystem offers a Makefile and a separate configuration file,
<code>config</code>, <code>config</code>,
which should be edited to suit your installation before runnig which should be edited to suit your installation before running
<code>make</code>. <code>make</code>.
The file has some definitions like paths to the external libraries, The file has some definitions like paths to the external libraries,
compiler options and the like. compiler options and the like.
@@ -82,12 +82,14 @@ compiler options and the like.
<h2><a name="installation"></a>Installation</h2> <h2><a name="installation"></a>Installation</h2>
<p>The LuaFileSystem compiled binary should be copied to a directory in your <p>The easiest way to install LuaFileSystem is to use LuaRocks:</p>
<a href="http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath">C path</a>.</p>
<p>Windows users can use the binary version of LuaFileSystem <pre class="example">
(<code>lfs.dll</code>) available at luarocks install lfs
<a href="http://luaforge.net/projects/luafilesystem/files">LuaForge</a>.</p> </pre>
<p>If you prefer to install LuaFileSystem manually, the compiled binary should be copied to a directory in your
<a href="http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath">C path</a>.</p>
<h2><a name="reference"></a>Reference</h2> <h2><a name="reference"></a>Reference</h2>
@@ -202,6 +204,12 @@ LuaFileSystem offers the following functions:
<dd>Removes an existing directory. The argument is the name of the directory.<br /> <dd>Removes an existing directory. The argument is the name of the directory.<br />
Returns <code>true</code> if the operation was successful; Returns <code>true</code> if the operation was successful;
in case of error, it returns <code>nil</code> plus an error string.</dd> in case of error, it returns <code>nil</code> plus an error string.</dd>
<dt><a name="setmode"></a><strong><code>lfs.setmode (filepath, mode)</code></strong></dt>
<dd>Sets the writing mode for a file. The mode string can be either <code>binary</code> or <code>text</code>.
Returns the previous mode string for the file. This function is only available in Windows, so you may want to make sure that
<code>lfs.setmode</code> exists before using it.
</dd>
<dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt> <dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt>
<dd>Identical to <a href="#attributes">lfs.attributes</a> except that <dd>Identical to <a href="#attributes">lfs.attributes</a> except that
@@ -240,7 +248,7 @@ LuaFileSystem offers the following functions:
<div id="about"> <div id="about">
<p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
<p><small>$Id: manual.html,v 1.38 2007/12/14 15:28:04 carregal Exp $</small></p> <p><small>$Id: manual.html,v 1.39 2008/02/11 22:42:21 carregal Exp $</small></p>
</div> <!-- id="about" --> </div> <!-- id="about" -->
</div> <!-- id="container" --> </div> <!-- id="container" -->

View File

@@ -1,6 +1,6 @@
/* /*
** LuaFileSystem ** LuaFileSystem
** Copyright Kepler Project 2004-2007 (http://www.keplerproject.org/luafilesystem) ** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
** **
** File system manipulation library. ** File system manipulation library.
** This library offers these functions: ** This library offers these functions:
@@ -11,11 +11,12 @@
** lfs.lock (fh, mode) ** lfs.lock (fh, mode)
** lfs.mkdir (path) ** lfs.mkdir (path)
** lfs.rmdir (path) ** lfs.rmdir (path)
** lfs.setmode (filepath, mode)
** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts ** lfs.symlinkattributes (filepath [, attributename]) -- thanks to Sam Roberts
** lfs.touch (filepath [, atime [, mtime]]) ** lfs.touch (filepath [, atime [, mtime]])
** lfs.unlock (fh) ** 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 <errno.h> #include <errno.h>
@@ -75,7 +76,7 @@ typedef struct dir_data {
#define _O_TEXT 0 #define _O_TEXT 0
#define _O_BINARY 0 #define _O_BINARY 0
#define lfs_setmode(L,file,m) ((void)((void)file,m), \ #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 #endif
/* /*
@@ -619,13 +620,13 @@ static int link_info (lua_State *L) {
*/ */
static void set_info (lua_State *L) { static void set_info (lua_State *L) {
lua_pushliteral (L, "_COPYRIGHT"); 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_settable (L, -3);
lua_pushliteral (L, "_DESCRIPTION"); 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_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_settable (L, -3);
lua_pushliteral (L, "_VERSION"); lua_pushliteral (L, "_VERSION");
lua_pushliteral (L, "LuaFileSystem 1.3.0"); lua_pushliteral (L, "LuaFileSystem 1.4.0");
lua_settable (L, -3); lua_settable (L, -3);
} }
@@ -636,11 +637,12 @@ static const struct luaL_reg fslib[] = {
{"currentdir", get_dir}, {"currentdir", get_dir},
{"dir", dir_iter_factory}, {"dir", dir_iter_factory},
{"lock", file_lock}, {"lock", file_lock},
{"setmode", lfs_f_setmode},
{"mkdir", make_dir}, {"mkdir", make_dir},
{"rmdir", remove_dir}, {"rmdir", remove_dir},
#ifndef _WIN32 #ifndef _WIN32
{"symlinkattributes", link_info}, {"symlinkattributes", link_info},
#else
{"setmode", lfs_f_setmode},
#endif #endif
{"touch", file_utime}, {"touch", file_utime},
{"unlock", file_unlock}, {"unlock", file_unlock},

View File

@@ -1,5 +1,5 @@
LIBRARY lfs.dll LIBRARY lfs.dll
DESCRIPTION "LuaFileSystem" DESCRIPTION "LuaFileSystem"
VERSION 1.2.1 VERSION 1.4.0
EXPORTS EXPORTS
luaopen_lfs luaopen_lfs

View File

@@ -1,16 +1,16 @@
/* /*
** LuaFileSystem ** LuaFileSystem
** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/luafilesystem) ** Copyright Kepler Project 2003 (http://www.keplerproject.org/luafilesystem)
** **
** $Id: lfs.h,v 1.3 2006/03/10 23:37:32 carregal Exp $ ** $Id: lfs.h,v 1.4 2008/02/11 22:42:21 carregal Exp $
*/ */
/* Define 'chdir' for systems that do not implement it */ /* Define 'chdir' for systems that do not implement it */
#ifdef NO_CHDIR #ifdef NO_CHDIR
#define chdir(p) (-1) #define chdir(p) (-1)
#define chdir_error "Function 'chdir' not provided by system" #define chdir_error "Function 'chdir' not provided by system"
#else #else
#define chdir_error strerror(errno) #define chdir_error strerror(errno)
#endif #endif
int luaopen_lfs (lua_State *L); int luaopen_lfs (lua_State *L);