aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarregal <carregal>2008-02-11 22:42:21 +0000
committercarregal <carregal>2008-02-11 22:42:21 +0000
commitb66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0 (patch)
tree3821afea9fa46010f0047accff73e6bd85bf68af
parent78f28b64686390592792e2d5abba26c6f815d534 (diff)
downloadluafilesystem-b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0.tar.gz
luafilesystem-b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0.tar.bz2
luafilesystem-b66ab2cae9f03c7b3ff75c97a4a5fc59df442fc0.zip
Preparing the 1.4.0 release.
Added documentation for lfs.setmode
-rw-r--r--Makefile4
-rw-r--r--Makefile.win4
-rw-r--r--README8
-rw-r--r--doc/us/index.html25
-rw-r--r--doc/us/license.html4
-rw-r--r--doc/us/manual.html22
-rw-r--r--src/lfs.c14
-rw-r--r--src/lfs.def10
-rw-r--r--src/lfs.h32
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 @@
1# $Id: Makefile,v 1.31 2008/01/23 02:48:47 mascarenhas Exp $ 1# $Id: Makefile,v 1.32 2008/02/11 22:42:21 carregal Exp $
2 2
3T= lfs 3T= lfs
4V= 1.3.0 4V= 1.4.0
5CONFIG= ./config 5CONFIG= ./config
6 6
7include $(CONFIG) 7include $(CONFIG)
diff --git a/Makefile.win b/Makefile.win
index 1fcd921..bc37183 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -1,7 +1,7 @@
1# $Id: Makefile.win,v 1.8 2008/01/23 02:50:08 mascarenhas Exp $ 1# $Id: Makefile.win,v 1.9 2008/02/11 22:42:21 carregal Exp $
2 2
3T= lfs 3T= lfs
4V= 1.3.0 4V= 1.4.0
5 5
6include config.win 6include config.win
7 7
diff --git a/README b/README
index 23fa331..0ccb3f0 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
1LuaFileSystem - File System Library for Lua 1LuaFileSystem - File System Library for Lua
2Copyright 2003-2007 Kepler Project 2Copyright 2003 Kepler Project
3http://www.keplerproject.org/luafilesystem 3http://www.keplerproject.org/luafilesystem
4 4
5Description 5Description
@@ -10,7 +10,11 @@ related to file systems offered by the standard Lua distribution.
10LuaFileSystem offers a portable way to access the underlying directory structure and file attributes. 10LuaFileSystem offers a portable way to access the underlying directory structure and file attributes.
11LuaFileSystem is free software and uses the same license as Lua 5.1 11LuaFileSystem is free software and uses the same license as Lua 5.1
12 12
13Current version is 1.3.0 13Current version is 1.4.0
14
15LuaRocks Installation
16---------------------
17luarocks install lfs
14 18
15Unix Installation 19Unix Installation
16----------------- 20-----------------
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.</p>
71 71
72<h2><a name="status"></a>Status</h2> 72<h2><a name="status"></a>Status</h2>
73 73
74<p>Current version is 1.3.0. It was developed for Lua 5.1.</p> 74<p>Current version is 1.4.0. It was developed for Lua 5.1.</p>
75 75
76<h2><a name="download"></a>Download</h2> 76<h2><a name="download"></a>Download</h2>
77 77
78<p>LuaFileSystem source can be downloaded from its 78<p>LuaFileSystem source can be downloaded from its
79<a href="http://luaforge.net/projects/luafilesystem/files">Lua Forge</a> 79<a href="http://luaforge.net/projects/luafilesystem/files">Lua Forge</a>
80page. If you are using 80page. If you are using
81<a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.2 a Windows binary 81<a href="http://luabinaries.luaforge.net">LuaBinaries</a> 5.1.3 a Windows binary
82version of LuaFileSystem can be found at the same LuaForge page.</p> 82version of LuaFileSystem (compiled with Visual Studio 2005 Express) can be found at the same LuaForge page.</p>
83 83
84<h2><a name="history"></a>History</h2> 84<h2><a name="history"></a>History</h2>
85 85
86<dl class="history"> 86<dl class="history">
87 <dt><strong>Version 1.3.0</strong> [26/Oct/2007]</dt> 87 <dt><strong>Version 1.4.0</strong> [12/Feb/2008]</dt>
88 <dd>
89 <ul>
90 <li><a href="manual.html#attributes"><code>lfs.attributes</code></a>
91 raises an error if attribute does not exist</li>
92 <li>added function
93 <a href="manual.html#setmode"><code>lfs.setmode</code></a>
94 (works only in non Windows systems).</li>
95 </ul>
96 </dd>
97
98 <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.3/">Version 1.3.0</a></strong> [26/Oct/2007]</dt>
88 <dd> 99 <dd>
89 <ul> 100 <ul>
90 <li>added function 101 <li>added function
@@ -107,14 +118,14 @@ version of LuaFileSystem can be found at the same LuaForge page.</p>
107 <a href="manual.html#attributes"><code>lfs.attributes</code></a></li> 118 <a href="manual.html#attributes"><code>lfs.attributes</code></a></li>
108 <li>added function 119 <li>added function
109 <a href="manual.html#rmdir"><code>lfs.rmdir</code></a></li> 120 <a href="manual.html#rmdir"><code>lfs.rmdir</code></a></li>
110 <li>bug correction on <code>lfs.dir</code></li> 121 <li>bug correction on <a href="manual.html#dir"><code>lfs.dir</code></a></li>
111 </ul> 122 </ul>
112 </dd> 123 </dd>
113 124
114 <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.1/">Version 1.1</a></strong> [30/May/2005]</dt> 125 <dt><strong><a href="http://www.keplerproject.org/luafilesystem/1.1/">Version 1.1</a></strong> [30/May/2005]</dt>
115 <dd> 126 <dd>
116 <ul> 127 <ul>
117 <li>added function <code>lfs.touch</code>.</li> 128 <li>added function <a href="manual.html#touch"><code>lfs.touch</code></a>.</li>
118 </ul> 129 </ul>
119 </dd> 130 </dd>
120 131
@@ -147,7 +158,7 @@ Comments are welcome!</p>
147 158
148<div id="about"> 159<div id="about">
149 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> 160 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
150 <p><small>$Id: index.html,v 1.38 2007/12/14 15:28:04 carregal Exp $</small></p> 161 <p><small>$Id: index.html,v 1.39 2008/02/11 22:42:21 carregal Exp $</small></p>
151</div> <!-- id="about" --> 162</div> <!-- id="about" -->
152 163
153</div> <!-- id="container" --> 164</div> <!-- id="container" -->
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&eacute; Carregal and Tom&aacute;s Guisasola.
85The implementation is not derived from licensed software.</p> 85The implementation is not derived from licensed software.</p>
86 86
87<hr/> 87<hr/>
88<p>Copyright &copy; 2004-2007 Kepler Project.</p> 88<p>Copyright &copy; 2003 Kepler Project.</p>
89 89
90<p>Permission is hereby granted, free of charge, to any person 90<p>Permission is hereby granted, free of charge, to any person
91obtaining a copy of this software and associated documentation 91obtaining a copy of this software and associated documentation
@@ -113,7 +113,7 @@ SOFTWARE.</p>
113 113
114<div id="about"> 114<div id="about">
115 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> 115 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
116 <p><small>$Id: license.html,v 1.12 2007/12/14 15:28:04 carregal Exp $</small></p> 116 <p><small>$Id: license.html,v 1.13 2008/02/11 22:42:21 carregal Exp $</small></p>
117</div><!-- id="about" --> 117</div><!-- id="about" -->
118 118
119</div><!-- id="container" --> 119</div><!-- id="container" -->
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.
74<p> 74<p>
75LuaFileSystem offers a Makefile and a separate configuration file, 75LuaFileSystem offers a Makefile and a separate configuration file,
76<code>config</code>, 76<code>config</code>,
77which should be edited to suit your installation before runnig 77which should be edited to suit your installation before running
78<code>make</code>. 78<code>make</code>.
79The file has some definitions like paths to the external libraries, 79The file has some definitions like paths to the external libraries,
80compiler options and the like. 80compiler options and the like.
@@ -82,12 +82,14 @@ compiler options and the like.
82 82
83<h2><a name="installation"></a>Installation</h2> 83<h2><a name="installation"></a>Installation</h2>
84 84
85<p>The LuaFileSystem compiled binary should be copied to a directory in your 85<p>The easiest way to install LuaFileSystem is to use LuaRocks:</p>
86<a href="http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath">C path</a>.</p> 86
87<pre class="example">
88luarocks install lfs
89</pre>
87 90
88<p>Windows users can use the binary version of LuaFileSystem 91<p>If you prefer to install LuaFileSystem manually, the compiled binary should be copied to a directory in your
89(<code>lfs.dll</code>) available at 92<a href="http://www.lua.org/manual/5.1/manual.html#pdf-package.cpath">C path</a>.</p>
90<a href="http://luaforge.net/projects/luafilesystem/files">LuaForge</a>.</p>
91 93
92<h2><a name="reference"></a>Reference</h2> 94<h2><a name="reference"></a>Reference</h2>
93 95
@@ -202,6 +204,12 @@ LuaFileSystem offers the following functions:
202 <dd>Removes an existing directory. The argument is the name of the directory.<br /> 204 <dd>Removes an existing directory. The argument is the name of the directory.<br />
203 Returns <code>true</code> if the operation was successful; 205 Returns <code>true</code> if the operation was successful;
204 in case of error, it returns <code>nil</code> plus an error string.</dd> 206 in case of error, it returns <code>nil</code> plus an error string.</dd>
207
208 <dt><a name="setmode"></a><strong><code>lfs.setmode (filepath, mode)</code></strong></dt>
209 <dd>Sets the writing mode for a file. The mode string can be either <code>binary</code> or <code>text</code>.
210 Returns the previous mode string for the file. This function is only available in Windows, so you may want to make sure that
211 <code>lfs.setmode</code> exists before using it.
212 </dd>
205 213
206 <dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt> 214 <dt><a name="symlinkattributes"></a><strong><code>lfs.symlinkattributes (filepath [, aname])</code></strong></dt>
207 <dd>Identical to <a href="#attributes">lfs.attributes</a> except that 215 <dd>Identical to <a href="#attributes">lfs.attributes</a> except that
@@ -240,7 +248,7 @@ LuaFileSystem offers the following functions:
240 248
241<div id="about"> 249<div id="about">
242 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p> 250 <p><a href="http://validator.w3.org/check?uri=referer">Valid XHTML 1.0!</a></p>
243 <p><small>$Id: manual.html,v 1.38 2007/12/14 15:28:04 carregal Exp $</small></p> 251 <p><small>$Id: manual.html,v 1.39 2008/02/11 22:42:21 carregal Exp $</small></p>
244</div> <!-- id="about" --> 252</div> <!-- id="about" -->
245 253
246</div> <!-- id="container" --> 254</div> <!-- id="container" -->
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 @@
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*/
620static void set_info (lua_State *L) { 621static 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 @@
1LIBRARY lfs.dll 1LIBRARY lfs.dll
2DESCRIPTION "LuaFileSystem" 2DESCRIPTION "LuaFileSystem"
3VERSION 1.2.1 3VERSION 1.4.0
4EXPORTS 4EXPORTS
5luaopen_lfs 5luaopen_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 @@
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
16int luaopen_lfs (lua_State *L); 16int luaopen_lfs (lua_State *L);