Commit Graph

341 Commits

Author SHA1 Message Date
Alexey Melnichuk
ebe20b66f0 Fix. Compile with MSVC and with gcc without -std=c99 2014-08-13 18:18:42 +05:00
Hisham Muhammad
601b4e5498 Merge pull request #44 from stefan991/fix-attribute-lookup
Fix attributes `blksize` and `blocks`
2014-08-09 14:54:41 -03:00
Stefan Hoffmann
4437e19455 Fix lfs.attributes(file, 'blksize')
fs.attributes(file, 'blksize') and fs.attributes(file, 'blocks) return
the wrong values.
Compare the whole attribute name instead of the first char and remove
buggy special casing with wrong indexes into the member array.
2014-08-09 12:33:33 +02:00
Stefan Hoffmann
6b178640f0 Add test target to Makefile
easy way to run the tests without installing the library
2014-08-09 12:11:20 +02:00
Hisham Muhammad
95573506c5 Remove old references v1_6_2 2014-01-29 21:43:20 -02:00
Hisham Muhammad
1b3e3d4b4b Add top-level LICENSE file. Closes #33. 2014-01-29 21:15:29 -02:00
Hisham Muhammad
3bfdafcf4c Fix documentation for setmode. Closes #32. 2014-01-29 20:33:43 -02:00
Hisham Muhammad
00b17c6f1a Merge branch 'master' of https://github.com/keplerproject/luafilesystem 2014-01-29 17:27:04 -02:00
Hisham Muhammad
2111509acc Improve indentation consistency 2014-01-29 17:26:45 -02:00
Hisham Muhammad
18afb5a089 Use local stylesheet, suitable for truly offline viewing. 2014-01-29 17:22:49 -02:00
Hisham Muhammad
ebf867f729 Remove outdated links 2014-01-29 17:21:59 -02:00
Hisham Muhammad
5be0c7156e Merge pull request #28 from moteus/patch-1
Fix. Prevents double close the same handle (#24)
2014-01-08 06:53:06 -08:00
Alexey Melnichuk
cc6007171b Fix. Prevents double close the same handle (#24)
lfs_unlock_dir can be called multiple times for the same object.
For example if lock:free is called manually.
Then lfs_unlock_dir will be called always
again, as soon as the LOCK_METATABLE is collected by GC.
This can lead to strange file errors later on, like closing
another file, which now has been assigned the same handle...
2014-01-08 16:18:31 +03:00
Hisham Muhammad
2b80db36f0 Merge pull request #27 from moteus/patch-1
Fix. Use intptr_t to file handle on Windows (#26)
2014-01-04 12:13:23 -08:00
Alexey Melnichuk
ab8348e9bc Fix. Use intptr_t to file handle on Windows (#26)
Tested on MS VS2008(x32) MinGW(x32) and MS VS2012(x64)
2014-01-04 10:02:16 +03:00
Fabio Mascarenhas
2fd989cd6c Merge pull request #21 from Mikhael-Danilov/patch-1
Update src/lfs.c
2013-09-24 06:48:18 -07:00
Mikhael-Danilov
b21e375840 Update src/lfs.c
Fix Windows build: make_link now returns int as it should
2013-02-20 22:19:05 +04:00
Fabio Mascarenhas
9c2679f9d7 Merge pull request #19 from devurandom/fix/warnings
Fix some warnings GCC produced on Linux
2012-10-04 07:25:54 -07:00
Fabio Mascarenhas
62d5dbe3b6 Merge pull request #18 from devurandom/fix/lua52
Full Lua 5.2 compatibility and adherance to modules-create-no-globals
2012-10-04 07:00:22 -07:00
Dennis Schridde
a0d6f9d239 Fix warnings: unused variable
On non-win32 lfs_setmode was defined to 0, ignoring all parameters.
Now the parameters are explicitly discarded.

Fixes:
src/lfs.c: In function ‘lfs_g_setmode’:
src/lfs.c:324:7: warning: unused variable ‘op’ [-Wunused-variable]
src/lfs.c:321:47: warning: unused parameter ‘f’ [-Wunused-parameter]
2012-10-04 10:55:13 +02:00
Dennis Schridde
b35607e8a4 Fix warning: C++ style comments are not allowed in ISO C90 2012-10-04 10:51:44 +02:00
Dennis Schridde
f42c1a1a38 Set global "lfs" when opening module
* Ensures backward compatibility with LFS 1.5
* Module name is defined as LFS_LIBNAME, similar to how Lua standard libraries are defined
2012-10-04 10:48:07 +02:00
Dennis Schridde
5e55437028 Bump version to 1.6.2 and set version via define in src/lfs.c to make it better visible 2012-10-03 02:58:57 +02:00
Dennis Schridde
8e7217e74f Full Lua 5.2 compatibility and adherance to modules-create-no-globals 2012-10-03 02:54:08 +02:00
Fabio Mascarenhas
944e325e29 fix build for Lua 5.2; version 1.6.1 2012-10-01 15:57:09 -03:00
Fabio Mascarenhas
201d18a497 Merge pull request #17 from rrthomas/master
Use Lua 5.2's own luaL_register
2012-10-01 11:53:35 -07:00
Reuben Thomas
584066ee86 lfs.c: use Lua 5.2's own luaL_register 2012-10-01 19:44:00 +01:00
Fabio Mascarenhas
d71c63cdb7 luafilesystem 1.6.0 2012-10-01 11:11:48 -03:00
Fabio Mascarenhas
4a299c53b6 Merge pull request #15 from ewmailing/master
Improvements to use of getcwd() for using the correct max path length
2012-09-26 06:49:35 -07:00
Fabio Mascarenhas
420db54f1e Merge pull request #14 from icgood/master
5.2 compatibility
2012-08-31 12:09:14 -07:00
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
Fabio Mascarenhas
84f1af5eef applied debian patches from enrico tassi 2012-04-08 20:25:40 -03:00
Ian Good
f634765b26 implements fake luaL_register in Lua 5.2+ 2012-02-28 03:37:14 +00:00
Fabio Mascarenhas
149e0fb8ec Merge pull request #8 from rrthomas/master
New lfs.link and other goodies
2011-06-09 14:09:31 -07:00
Reuben Thomas
83faa7e05d Simplify and clarify metatable creation functions. 2011-06-09 20:35:12 +01:00
Reuben Thomas
3cea6c6e96 Add lfs.link. 2011-06-09 19:53:41 +01:00
Reuben Thomas
7e979318bd Use package.config to get directory separator. 2011-06-09 19:53:41 +01:00
Reuben Thomas
de03ad370c Add a comment for make_dir. 2011-06-09 19:53:41 +01:00
Reuben Thomas
fbdff8f1a5 Fix typo in manual. 2011-06-09 19:53:41 +01:00
Reuben Thomas
f42e7e3543 Simplify dir_iter_factory slightly. 2011-06-09 19:53:41 +01:00
Reuben Thomas
d61eb8078d Add .gitignore for *.o and *.so. 2011-06-09 19:53:41 +01:00
Reuben Thomas
361cede4d0 Add trivial implementation of setmode on non-Windows platforms. 2011-06-09 19:53:41 +01:00
Reuben Thomas
3140ca4db8 Make test.lua find its interpreter using /usr/bin/env. 2011-06-09 19:53:41 +01:00
Reuben Thomas
530c9140c7 Add trivial link_info support on Windows (using STAT_FUNC). 2011-06-09 19:53:41 +01:00
Fabio Mascarenhas
d292b3243f update links to bug tracker and cvs 2011-06-06 10:53:39 -03:00
Fabio Mascarenhas
2f55c33b0c change to build with lua 5.2 alpha, issue #5 2011-06-06 10:49:39 -03:00
Fabio Mascarenhas
ae5a05deec fixed dir length bug in windows directory iterator 2010-06-09 14:14:25 -03:00
Fabio Mascarenhas
fd028d3257 removed umask calls in lfs.mkdir, see kepler-list message from Enrico at 2009-12-27 2009-12-29 17:06:25 -02:00
Fabio Mascarenhas
8ff20138af packaging for version 1.5.0 - changing _VERSION v1.5.0 2009-10-20 18:54:35 -02:00
Fabio Mascarenhas
5ffde8ae51 packaging for version 1.5.0 2009-10-20 18:54:02 -02:00