Eric Wing 37c2309a40 Due to Android (and apparently Sun) not supporting getcwd(NULL, 0), I've changed to call to getcwd to specify a buffer and explicit size which successfully works around the problem. One minor performance advantage is that one less malloc/free is needed since the buffer is now created on the stack. Apparently, this was already changed in a prior commit I didn't see initially, but I think the use of an invented/arbitrary PATH_MAX is incorrect. Platforms should generally provide a constant for this and PATH_MAX itself is already defined on some systems like Linux which can cause collisions. This commit improves on those changes by leveraging the constants provided by the compiler/system.
To help keep the code consistent but still correct, new platform specific code needed to be introduced for the max length. On POSIX I am assuming it is that <sys/param.h> provides MAXPATHLEN. This is what the Mac/BSD man page says to use and verified this is also defined on Ubuntu Linux and Android. On Windows, MAX_PATH is used. MAX_PATH seems to still be 260 which seems kind of small; is there a different constant we are supposed to use? In both cases, the respective constants are mapped to a new #define for LFS_MAXPATHLEN to allow the code to refer to one constant and avoid any potential name collisions in case MAXPATHLEN is defined already by something else on Windows (e.g. Cygwin).
2012-05-01 14:38:02 -07:00
2011-06-09 19:53:41 +01:00
2009-10-20 18:54:02 -02:00
2006-03-15 18:27:13 +00:00
2007-10-27 22:42:32 +00:00
2008-03-25 17:39:29 +00:00
2009-09-21 17:02:44 +00:00
2008-05-07 19:06:37 +00:00
2009-10-20 18:54:02 -02:00

LuaFileSystem - File System Library for Lua
Copyright 2003 Kepler Project
http://www.keplerproject.org/luafilesystem

Description
-----------
LuaFileSystem is a Lua library developed to complement the set of functions
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

LuaRocks Installation
---------------------
luarocks install luafilesystem


Documentation
-------------
Please check the documentation at doc/us/ for more information.

History
-------

Version 1.5.0 [20/Oct/2009]
	* added explicit next and close methods to second return value of lfs.dir (the directory object), for explicit iteration or explicit closing.
	* added directory locking via lfs.lock_dir function (see the manual).

Version 1.4.2 [03/Feb/2009]

        * fixed bug [#13198] lfs.attributes(filename, 'size') overflow on files > 2 Gb again (bug report and patch by KUBO Takehiro).
        * fixed bug [#39794] Compile error on Solaris 10 (bug report and patch by Aaron B).
        * fixed compilation problems with Borland C.

Version 1.4.1 [07/May/2008]

        * documentation review
        * fixed Windows compilation issues
        * fixed bug in the Windows tests (patch by Shmuel Zeigerman)
        * fixed bug [#2185] lfs.attributes(filename, 'size') overflow on files > 2 Gb

Version 1.4.0 [13/Feb/2008]

        * added function lfs.setmode (works only in Windows systems).
        * lfs.attributes raises an error if attribute does not exist

Version 1.3.0 [26/Oct/2007]

        * added function lfs.symlinkattributes (works only in non Windows systems).

Version 1.2.1 [08/May/2007]

        * compatible only with Lua 5.1 (Lua 5.0 support was dropped)

Version 1.2 [15/Mar/2006]

        * added optional argument to lfs.attributes
        * added function lfs.rmdir
        * bug correction on lfs.dir

Version 1.1 [30/May/2005]

        * added function lfs.touch.

Version 1.0 [21/Jan/2005]
Version 1.0 Beta [10/Nov/2004]
Description
No description provided
Readme MIT 620 KiB
Languages
C 77.2%
Lua 21.5%
Makefile 1.3%