mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-22 11:03:07 +00:00
Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a186cca583 | ||
|
|
31dcb88b12 | ||
|
|
0951178220 | ||
|
|
268c2d3830 | ||
|
|
b6abbb63b1 | ||
|
|
71ae24046c | ||
|
|
ff2cbc21f1 | ||
|
|
97b522ec12 | ||
|
|
472cd783d7 | ||
|
|
912e06714f | ||
|
|
e4eae33de5 | ||
|
|
3c8d96b77f | ||
|
|
9cbe5cba90 | ||
|
|
772fe81c67 | ||
|
|
f77f24850b | ||
|
|
211c2a5d89 | ||
|
|
7c6e1b013c | ||
|
|
68c624c686 | ||
|
|
41e59da31b | ||
|
|
842505b6a3 | ||
|
|
3e879ffba1 | ||
|
|
4f7e1b5a49 | ||
|
|
a5336d294d | ||
|
|
6048863a96 | ||
|
|
1a61e5284d | ||
|
|
7cb7d86dc4 | ||
|
|
94700f7c18 | ||
|
|
53d2acc517 | ||
|
|
6b11508ea9 | ||
|
|
58cf8c9449 | ||
|
|
04ba8d686a | ||
|
|
04bdaf9a1e | ||
|
|
1dfb8c41e8 | ||
|
|
37d8524e7e | ||
|
|
e5f06c270a | ||
|
|
884b52a3b2 |
78
.github/workflows/ci.yml
vendored
Normal file
78
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
name: ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
TestMatrix:
|
||||
strategy:
|
||||
matrix:
|
||||
lua-version: ["5.4", "5.3", "5.2", "5.1", "luajit"]
|
||||
os: ["ubuntu-latest"]
|
||||
libflag: ["-shared --coverage"]
|
||||
include:
|
||||
- os: "macos-latest"
|
||||
lua-version: "5.4"
|
||||
libflag: "-bundle -undefined dynamic_lookup -all_load --coverage"
|
||||
- os: "windows-latest"
|
||||
toolchain: "msvc"
|
||||
lua-version: "5.4"
|
||||
- os: "windows-latest"
|
||||
lua-version: "luajit"
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Setup MSVC
|
||||
# 'luarocks/gh-actions-lua' step requires msvc to build PUC-Rio Lua
|
||||
# versions on Windows (LuaJIT will be built using MinGW/gcc).
|
||||
if: ${{ matrix.toolchain == 'msvc' }}
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- uses: luarocks/gh-actions-lua@master
|
||||
with:
|
||||
luaVersion: ${{ matrix.lua-version }}
|
||||
|
||||
- uses: luarocks/gh-actions-luarocks@master
|
||||
|
||||
- name: Prep luacov
|
||||
run: |
|
||||
luarocks install luacov
|
||||
|
||||
- name: Prep luacov-coveralls
|
||||
# TODO Windows coverage
|
||||
if: ${{ matrix.os != 'windows-latest' }}
|
||||
run: |
|
||||
pip install --user cpp-coveralls
|
||||
# install luacov-coveralls, but avoid installing luafilesystem
|
||||
luarocks install lua-path
|
||||
luarocks install dkjson
|
||||
luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=none
|
||||
|
||||
- name: Unix Build
|
||||
if: ${{ matrix.os != 'windows-latest' }}
|
||||
run: |
|
||||
luarocks make CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="${{ matrix.libflag }}"
|
||||
|
||||
- name: Windows Build
|
||||
# TODO Windows coverage
|
||||
if: ${{ matrix.os == 'windows-latest' }}
|
||||
run: |
|
||||
luarocks make
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
lua -lluacov tests/test.lua
|
||||
|
||||
- name: Coverage
|
||||
# TODO Windows coverage
|
||||
if: ${{ matrix.os != 'windows-latest' }}
|
||||
run: |
|
||||
export MY_PYTHON_VER=$(python -c 'import sys; print(".".join(sys.version.split(".")[0:2]))')
|
||||
export PATH="/Users/runner/Library/Python/$MY_PYTHON_VER/bin:$PATH"
|
||||
coveralls -b . -i src --dump c.report.json
|
||||
luacov-coveralls -j c.report.json -v -t ${{ secrets.GITHUB_TOKEN }}
|
||||
35
.travis.yml
35
.travis.yml
@@ -1,35 +0,0 @@
|
||||
language: c
|
||||
|
||||
sudo: false
|
||||
|
||||
env:
|
||||
- LUA="lua 5.1"
|
||||
- LUA="lua 5.2"
|
||||
- LUA="lua 5.3"
|
||||
- LUA="luajit 2.0"
|
||||
- LUA="luajit 2.1"
|
||||
|
||||
before_install:
|
||||
- pip install --user cpp-coveralls hererocks
|
||||
- hererocks env --$LUA --luarocks latest
|
||||
- export PATH="$PWD/env/bin:$PATH"
|
||||
- luarocks install lua-path
|
||||
- luarocks install dkjson
|
||||
- luarocks install luacov
|
||||
# install luacov-coveralls, but avoid installing luafilesystem
|
||||
- luarocks install luacov-coveralls --server=https://luarocks.org/dev --deps-mode=none
|
||||
|
||||
install:
|
||||
- luarocks make rockspecs/luafilesystem-cvs-3.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
|
||||
|
||||
script:
|
||||
- lua -lluacov tests/test.lua
|
||||
|
||||
after_success:
|
||||
- coveralls -b . -i src --dump c.report.json
|
||||
- luacov-coveralls -j c.report.json -v
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: change
|
||||
on_failure: always
|
||||
3
LICENSE
3
LICENSE
@@ -1,4 +1,5 @@
|
||||
Copyright © 2003-2014 Kepler Project.
|
||||
Copyright © 2003-2010 Kepler Project.
|
||||
Copyright © 2010-2022 The LuaFileSystem authors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
|
||||
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ OBJS= src/$T.o
|
||||
lib: src/lfs.so
|
||||
|
||||
src/lfs.so: $(OBJS)
|
||||
MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(LIB_OPTION) -o src/lfs.so $(OBJS)
|
||||
MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET); export MACOSX_DEPLOYMENT_TARGET; $(CC) $(LIB_OPTION) -o src/lfs.so $(OBJS)
|
||||
|
||||
test: lib
|
||||
LUA_CPATH=./src/?.so lua tests/test.lua
|
||||
|
||||
10
README.md
10
README.md
@@ -1,13 +1,11 @@
|
||||
[](LICENSE)
|
||||
[](https://travis-ci.org/keplerproject/luafilesystem)
|
||||
[](https://github.com/lunarmodules/luafilesystem/actions)
|
||||
[](https://ci.appveyor.com/project/ignacio/luafilesystem)
|
||||
[](https://coveralls.io/r/keplerproject/luafilesystem)
|
||||
[](https://coveralls.io/r/lunarmodules/luafilesystem)
|
||||
|
||||
# LuaFileSystem - File System Library for Lua
|
||||
|
||||
Copyright 2003-2017 Kepler Project
|
||||
|
||||
https://keplerproject.github.io/luafilesystem
|
||||
https://lunarmodules.github.io/luafilesystem
|
||||
|
||||
# Description
|
||||
|
||||
@@ -25,4 +23,4 @@ luarocks install luafilesystem
|
||||
|
||||
# Documentation
|
||||
|
||||
Please check the documentation at doc/us/ for more information.
|
||||
Please check the at `docs/` for more information, also available at the [project website](https://lunarmodules.github.io/luafilesystem).
|
||||
|
||||
49
appveyor.yml
49
appveyor.yml
@@ -1,18 +1,25 @@
|
||||
version: 0.0.1.{build}-test
|
||||
|
||||
# Use default image unless needed
|
||||
#os:
|
||||
#- Windows Server 2012 R2
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- LUA: "lua 5.1"
|
||||
- LUA: "lua 5.2 --compat none"
|
||||
- LUA: "lua 5.3 --compat none"
|
||||
- LUA: "luajit 2.0"
|
||||
- LUA: "luajit 2.1"
|
||||
- LUAT: "lua"
|
||||
LUAV: "5.1"
|
||||
- LUAT: "lua"
|
||||
LUAV: "5.2"
|
||||
HEREROCKS_FLAGS: "--compat none"
|
||||
- LUAT: "lua"
|
||||
LUAV: "5.3"
|
||||
HEREROCKS_FLAGS: "--compat none"
|
||||
- LUAT: "lua"
|
||||
LUAV: "5.4"
|
||||
HEREROCKS_FLAGS: "--compat none"
|
||||
- LUAT: "luajit"
|
||||
LUAV: "2.1"
|
||||
|
||||
# Abuse this section so we can have a matrix with different Compiler versions
|
||||
configuration:
|
||||
@@ -20,17 +27,17 @@ configuration:
|
||||
- vs_32
|
||||
- vs_64
|
||||
|
||||
install:
|
||||
- set PATH=%CD%\env\bin;C:\Python27\Scripts;C:\MinGW\bin;%PATH%
|
||||
- pip install hererocks
|
||||
- hererocks env --%LUA% --target %configuration% --luarocks latest
|
||||
|
||||
before_build:
|
||||
# @todo
|
||||
- echo "Installing external deps"
|
||||
- set PATH=C:\MinGW\bin;%PATH%
|
||||
- set PATH=C:\Python37;C:\Python37\Scripts;%PATH% # Add directory containing 'pip' to PATH
|
||||
- IF NOT EXIST lua_install-%LUAV%\bin\activate.bat ( pip install --upgrade certifi )
|
||||
- FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "import certifi;print(certifi.where())"`) DO ( SET SSL_CERT_FILE=%%F )
|
||||
- IF NOT EXIST lua_install-%LUAV%\bin\activate.bat ( pip install hererocks )
|
||||
- IF NOT EXIST lua_install-%LUAV%\bin\activate.bat ( hererocks lua_install-%LUAV% --%LUAT% %LUAV% %HEREROCKS_FLAGS% --luarocks latest --target=%configuration% )
|
||||
- call lua_install-%LUAV%\bin\activate
|
||||
|
||||
build_script:
|
||||
- luarocks make rockspecs/luafilesystem-cvs-3.rockspec
|
||||
- luarocks make
|
||||
|
||||
before_test:
|
||||
|
||||
@@ -38,5 +45,9 @@ test_script:
|
||||
- echo "Testing..."
|
||||
- lua tests/test.lua
|
||||
|
||||
after_test:
|
||||
# @todo
|
||||
cache:
|
||||
- lua_install-5.4
|
||||
- lua_install-5.3
|
||||
- lua_install-5.2
|
||||
- lua_install-5.1
|
||||
- lua_install-2.1
|
||||
|
||||
12
config
12
config
@@ -3,21 +3,25 @@
|
||||
# Default installation prefix
|
||||
PREFIX=/usr/local
|
||||
|
||||
LUA_VERSION = 5.1
|
||||
|
||||
# System's libraries directory (where binary libraries are installed)
|
||||
LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
|
||||
LUA_LIBDIR= $(PREFIX)/lib/lua/$(LUA_VERSION)
|
||||
|
||||
# Lua includes directory
|
||||
LUA_INC= $(PREFIX)/include
|
||||
LUA_INC += -I$(PREFIX)/include
|
||||
LUA_INC += -I/usr/include/lua$(LUA_VERSION) -I/usr/include/lua/$(LUA_VERSION)
|
||||
|
||||
# OS dependent
|
||||
LIB_OPTION= -shared #for Linux
|
||||
#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
|
||||
|
||||
LIBNAME= $T.so.$V
|
||||
# Minimum runtime OS version on macOS
|
||||
MACOSX_DEPLOYMENT_TARGET= 10.5
|
||||
|
||||
# Compilation directives
|
||||
WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
|
||||
INCS= -I$(LUA_INC)
|
||||
INCS= $(LUA_INC)
|
||||
CFLAGS= $(WARN) $(INCS)
|
||||
CC= gcc
|
||||
|
||||
|
||||
10
config.win
10
config.win
@@ -1,14 +1,14 @@
|
||||
LUA_VERSION= 5.1
|
||||
|
||||
# Installation directories
|
||||
# System's libraries directory (where binary libraries are installed)
|
||||
LUA_LIBDIR= "c:\lua5.1"
|
||||
LUA_LIBDIR= "c:\lua$(LUA_VERSION)"
|
||||
|
||||
# Lua includes directory
|
||||
LUA_INC= "c:\lua5.1\include"
|
||||
LUA_INC= "c:\lua$(LUA_VERSION)\include"
|
||||
|
||||
# Lua library
|
||||
LUA_LIB= "c:\lua5.1\lua5.1.lib"
|
||||
|
||||
LIBNAME= $T.dll
|
||||
LUA_LIB= "c:\lua$(LUA_VERSION)\lua$(LUA_VERSION).lib"
|
||||
|
||||
# Compilation directives
|
||||
WARN= /O2
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo">
|
||||
<a href="http://keplerproject.github.io/luafilesystem">
|
||||
<a href="http://lunarmodules.github.io/luafilesystem">
|
||||
<img alt="LuaFileSystem" src="luafilesystem.png"/>
|
||||
</a>
|
||||
</div>
|
||||
@@ -44,10 +44,10 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Examples</strong></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Project</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Git</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="license.html">License</a></li>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo">
|
||||
<a href="http://keplerproject.github.io/luafilesystem">
|
||||
<a href="http://lunarmodules.github.io/luafilesystem">
|
||||
<img alt="LuaFileSystem" src="luafilesystem.png"/>
|
||||
</a>
|
||||
</div>
|
||||
@@ -44,10 +44,10 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="examples.html">Examples</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Project</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Git</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="license.html">License</a></li>
|
||||
@@ -70,7 +70,7 @@ the underlying directory structure and file attributes.</p>
|
||||
|
||||
<h2><a name="status"></a>Status</h2>
|
||||
|
||||
<p>Current version is 1.7.0. It works with Lua 5.1, 5.2 and 5.3, and it runs on various
|
||||
<p>Current version is 1.9.0. It works with Lua 5.1 to Lua 5.5, and it runs on various
|
||||
flavors of Unix (including Linux, BSDs, macOS) and Windows.</p>
|
||||
|
||||
<h2><a name="download"></a>Download</h2>
|
||||
@@ -81,11 +81,27 @@ flavors of Unix (including Linux, BSDs, macOS) and Windows.</p>
|
||||
$ luarocks install luafilesystem
|
||||
</pre>
|
||||
|
||||
<p>Its source can be found at its <a href="http://github.com/keplerproject/luafilesystem">Github</a> page.</p>
|
||||
<p>Its source can be found at its <a href="http://github.com/lunarmodules/luafilesystem">GitHub</a> page.</p>
|
||||
|
||||
<h2><a name="history"></a>History</h2>
|
||||
|
||||
<dl class="history">
|
||||
<dt><strong>Version 1.9.0</strong> [28/Dec/2025]</dt>
|
||||
<dd><ul>
|
||||
<li>Lua 5.5 support</li>
|
||||
<li>Fixed some compiler warnings</li>
|
||||
<li>Assorted improvements for Windows</li>
|
||||
</ul></dd>
|
||||
|
||||
<dt><strong>Version 1.8.0</strong> [22/Apr/2020]</dt>
|
||||
<dd><ul>
|
||||
<li>Lua 5.4 support</li>
|
||||
<li>lfs.link and lfs.symlinkattributes now work on Windows</li>
|
||||
<li>MACOSX_DEPLOYMENT_TARGET is configurable in the Makefile</li>
|
||||
<li>Fallback to _POSIX_PATH_MAX when MAXPATHLEN is not avaliable</li>
|
||||
<li>Fixed memory leak in case of realloc failure</li>
|
||||
</ul></dd>
|
||||
|
||||
<dt><strong>Version 1.7.0</strong> [15/Sep/2017]</dt>
|
||||
<dd><ul>
|
||||
<li>symlinkattributes function now provides 'target' field, containing name of the file that the symlink points to.</li>
|
||||
@@ -201,10 +217,11 @@ $ luarocks install luafilesystem
|
||||
|
||||
<h2><a name="credits"></a>Credits</h2>
|
||||
|
||||
<p>LuaFileSystem was designed by Roberto Ierusalimschy,
|
||||
André Carregal and Tomás Guisasola as part of the
|
||||
<a href="https://github.com/keplerproject">Kepler Project</a>,
|
||||
which holds its copyright. LuaFileSystem is currently maintained by Fábio Mascarenhas.</p>
|
||||
<p>The LuaFileSystem library was originally designed and
|
||||
implemented by Roberto Ierusalimschy, André Carregal and
|
||||
Tomás Guisasola. It was then maintained by Fábio
|
||||
Mascarenhas for several years and has since been maintained
|
||||
by many contributors -- see the Git history for detailed credits.</p>
|
||||
|
||||
</div> <!-- id="content" -->
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo">
|
||||
<a href="http://keplerproject.github.io/luafilesystem">
|
||||
<a href="http://lunarmodules.github.io/luafilesystem">
|
||||
<img alt="LuaFileSystem" src="luafilesystem.png"/>
|
||||
</a>
|
||||
</div>
|
||||
@@ -44,10 +44,10 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="examples.html">Examples</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Project</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Git</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>License</strong></li>
|
||||
@@ -58,33 +58,21 @@
|
||||
|
||||
<h1>License</h1>
|
||||
|
||||
<p>
|
||||
LuaFileSystem is free software: it can be used for both academic
|
||||
and commercial purposes at absolutely no cost. There are no
|
||||
royalties or GNU-like "copyleft" restrictions. LuaFileSystem
|
||||
qualifies as
|
||||
<a href="http://www.opensource.org/docs/definition.html">Open Source</a>
|
||||
software.
|
||||
Its licenses are compatible with
|
||||
<a href="http://www.gnu.org/licenses/gpl.html">GPL</a>.
|
||||
LuaFileSystem is not in the public domain and the
|
||||
<a href="https://github.com/keplerproject">Kepler Project</a>
|
||||
keep its copyright.
|
||||
The legal details are below.
|
||||
</p>
|
||||
|
||||
<p>The spirit of the license is that you are free to use
|
||||
LuaFileSystem for any purpose at no cost without having to ask us.
|
||||
The only requirement is that if you do use LuaFileSystem, then you
|
||||
should give us credit by including the appropriate copyright notice
|
||||
somewhere in your product or its documentation.</p>
|
||||
|
||||
<p>The LuaFileSystem library is designed and implemented by Roberto
|
||||
Ierusalimschy, André Carregal and Tomás Guisasola.
|
||||
The implementation is not derived from licensed software.</p>
|
||||
<p>The LuaFileSystem library was originally designed and
|
||||
implemented by Roberto Ierusalimschy, André Carregal and
|
||||
Tomás Guisasola, and has since been maintained over the years
|
||||
by many people -- see the Git history for detailed credits.
|
||||
The implementation is not derived from any other licensed software.</p>
|
||||
|
||||
<hr/>
|
||||
<p>Copyright © 2003 - 2017 Kepler Project.</p>
|
||||
<p>Copyright © 2003 - 2010 Kepler Project.</p>
|
||||
<p>Copyright © 2010 - 2022 The LuaFileSystem authors.</p>
|
||||
|
||||
<p>Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -13,7 +13,7 @@
|
||||
|
||||
<div id="product">
|
||||
<div id="product_logo">
|
||||
<a href="http://keplerproject.github.io/luafilesystem">
|
||||
<a href="http://lunarmodules.github.io/luafilesystem">
|
||||
<img alt="LuaFileSystem" src="luafilesystem.png"/>
|
||||
</a>
|
||||
</div>
|
||||
@@ -44,10 +44,10 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="examples.html">Examples</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Project</a>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Project</a>
|
||||
<ul>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/keplerproject/luafilesystem">Git</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem/issues">Bug Tracker</a></li>
|
||||
<li><a href="https://github.com/lunarmodules/luafilesystem">Git</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="license.html">License</a></li>
|
||||
@@ -102,15 +102,15 @@ LuaFileSystem offers the following functions:
|
||||
</p>
|
||||
|
||||
<dl class="reference">
|
||||
<dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, aname | atable])</code></strong></dt>
|
||||
<dt><a name="attributes"></a><strong><code>lfs.attributes (filepath [, request_name | result_table])</code></strong></dt>
|
||||
<dd>Returns a table with the file attributes corresponding to
|
||||
<code>filepath</code> (or <code>nil</code> followed by an error message and a system-dependent error code
|
||||
in case of error).
|
||||
If the second optional argument is given and is a string, then only the value of the
|
||||
named attribute is returned (this use is equivalent to
|
||||
<code>lfs.attributes(filepath)[aname]</code>, but the table is not created
|
||||
<code>lfs.attributes(filepath)[request_name]</code>, but the table is not created
|
||||
and only one attribute is retrieved from the O.S.).
|
||||
if a table is passed as the second argument, it is filled with attributes and returned instead of a new table.
|
||||
if a table is passed as the second argument, it (<code>result_table</code>) is filled with attributes and returned instead of a new table.
|
||||
The attributes are described as follows;
|
||||
attribute <code>mode</code> is a string, all the others are numbers,
|
||||
and the time related attributes use the same time reference of
|
||||
@@ -239,7 +239,7 @@ LuaFileSystem offers the following functions:
|
||||
setting the mode has no effect, and the mode is always returned as <code>binary</code>.
|
||||
</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 [, request_name])</code></strong></dt>
|
||||
<dd>Identical to <a href="#attributes">lfs.attributes</a> except that
|
||||
it obtains information about the link itself (not the file it refers to).
|
||||
It also adds a <strong><code>target</code></strong> field, containing
|
||||
@@ -1,8 +1,7 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.7.0-1"
|
||||
package = "luafilesystem"
|
||||
version = "scm-1"
|
||||
source = {
|
||||
url = "git://github.com/keplerproject/luafilesystem",
|
||||
tag = "v1_7_0",
|
||||
url = "git+https://github.com/lunarmodules/luafilesystem"
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
@@ -12,7 +11,7 @@ description = {
|
||||
distribution. LuaFileSystem offers a portable way to access the
|
||||
underlying directory structure and file attributes.
|
||||
]],
|
||||
license = "MIT/X11",
|
||||
license = "MIT/X11"
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
@@ -23,6 +22,7 @@ build = {
|
||||
lfs = "src/lfs.c"
|
||||
},
|
||||
copy_directories = {
|
||||
"doc", "tests"
|
||||
"docs",
|
||||
"tests"
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.3.0-1"
|
||||
source = {
|
||||
url = "http://luaforge.net/frs/download.php/2679/luafilesystem-1.3.0.tar.gz"
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LUA_INC = "$(LUA_INCDIR)",
|
||||
LIB_OPTION = "$(LIBFLAG)"
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)"
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.4.0-1"
|
||||
source = {
|
||||
url = "http://luaforge.net/frs/download.php/3158/luafilesystem-1.4.0.tar.gz"
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LUA_INC = "$(LUA_INCDIR)",
|
||||
LIB_OPTION = "$(LIBFLAG)"
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)"
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.4.0-2"
|
||||
source = {
|
||||
url = "http://luaforge.net/frs/download.php/3158/luafilesystem-1.4.0.tar.gz"
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
platforms = {
|
||||
unix = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LIB_OPTION = "$(LIBFLAG)",
|
||||
CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)"
|
||||
}
|
||||
},
|
||||
win32 = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
|
||||
CFLAGS = "/MD $(CFLAGS) /I$(LUA_INCDIR)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)",
|
||||
LUA_DIR = "$(LUADIR)",
|
||||
BIN_DIR = "$(BINDIR)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.4.1-1"
|
||||
source = {
|
||||
url = "http://luaforge.net/frs/download.php/3345/luafilesystem-1.4.1.tar.gz",
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
platforms = {
|
||||
unix = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LIB_OPTION = "$(LIBFLAG)",
|
||||
CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR) $(STAT64)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)"
|
||||
}
|
||||
},
|
||||
win32 = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
|
||||
CFLAGS = "/MD $(CFLAGS) /I$(LUA_INCDIR)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)",
|
||||
LUA_DIR = "$(LUADIR)",
|
||||
BIN_DIR = "$(BINDIR)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.4.1rc1-1"
|
||||
source = {
|
||||
url = "http://luafilesystem.luaforge.net/luafilesystem-1.4.1rc1.tar.gz",
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
platforms = {
|
||||
unix = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LIB_OPTION = "$(LIBFLAG)",
|
||||
CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR) $(STAT64)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)"
|
||||
}
|
||||
},
|
||||
win32 = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
|
||||
CFLAGS = "/MD $(CFLAGS) /I$(LUA_INCDIR)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)",
|
||||
LUA_DIR = "$(LUADIR)",
|
||||
BIN_DIR = "$(BINDIR)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "1.4.2-1"
|
||||
|
||||
source = {
|
||||
url = "http://luaforge.net/frs/download.php/3931/luafilesystem-1.4.2.tar.gz",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "module",
|
||||
modules = { lfs = "src/lfs.c" }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "1.5.0-1"
|
||||
|
||||
source = {
|
||||
url = "http://cloud.github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.5.0.tar.gz",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "module",
|
||||
modules = { lfs = "src/lfs.c" },
|
||||
copy_directories = { "doc", "tests" }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "1.6.0-1"
|
||||
|
||||
source = {
|
||||
url = "https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.6.0.tar.gz",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = { lfs = "src/lfs.c" },
|
||||
copy_directories = { "doc", "tests" }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "1.6.1-1"
|
||||
|
||||
source = {
|
||||
url = "https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.6.1.tar.gz",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = { lfs = "src/lfs.c" },
|
||||
copy_directories = { "doc", "tests" }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "1.6.2-1"
|
||||
|
||||
source = {
|
||||
url = "https://github.com/downloads/keplerproject/luafilesystem/luafilesystem-1.6.2.tar.gz",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = { lfs = "src/lfs.c" },
|
||||
copy_directories = { "doc", "tests" }
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.6.3-1"
|
||||
source = {
|
||||
url = "git://github.com/keplerproject/luafilesystem",
|
||||
tag = "v_1_6_3",
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]],
|
||||
license = "MIT/X11",
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = {
|
||||
lfs = "src/lfs.c"
|
||||
},
|
||||
copy_directories = {
|
||||
"doc", "tests"
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "1.7.0-2"
|
||||
source = {
|
||||
url = "git://github.com/keplerproject/luafilesystem",
|
||||
tag = "v1_7_0_2",
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]],
|
||||
license = "MIT/X11",
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = {
|
||||
lfs = "src/lfs.c"
|
||||
},
|
||||
copy_directories = {
|
||||
"doc", "tests"
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
version = "cvs-1"
|
||||
source = {
|
||||
url = "cvs://:pserver:anonymous:@cvs.luaforge.net:/cvsroot/luafilesystem",
|
||||
cvs_tag = "HEAD"
|
||||
}
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
build = {
|
||||
platforms = {
|
||||
unix = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LIB_OPTION = "$(LIBFLAG)",
|
||||
CFLAGS = "$(CFLAGS) -I$(LUA_INCDIR)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)"
|
||||
}
|
||||
},
|
||||
win32 = {
|
||||
type = "make",
|
||||
build_variables = {
|
||||
LUA_LIB = "$(LUA_LIBDIR)\\lua5.1.lib",
|
||||
CFLAGS = "$(CFLAGS) /I$(LUA_INCDIR)",
|
||||
},
|
||||
install_variables = {
|
||||
LUA_LIBDIR = "$(LIBDIR)",
|
||||
LUA_DIR = "$(LUADIR)",
|
||||
BIN_DIR = "$(BINDIR)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "cvs-2"
|
||||
|
||||
source = {
|
||||
url = "git://github.com/keplerproject/luafilesystem.git",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "module",
|
||||
modules = { lfs = "src/lfs.c" }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package = "LuaFileSystem"
|
||||
|
||||
version = "cvs-3"
|
||||
|
||||
source = {
|
||||
url = "git://github.com/keplerproject/luafilesystem.git",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "File System Library for the Lua Programming Language",
|
||||
detailed = [[
|
||||
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.
|
||||
]]
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1, < 5.4"
|
||||
}
|
||||
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = { lfs = "src/lfs.c" },
|
||||
copy_directories = { "doc", "tests" }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
LIBRARY lfs.dll
|
||||
VERSION 1.7
|
||||
VERSION 1.9
|
||||
EXPORTS
|
||||
luaopen_lfs
|
||||
|
||||
30
src/lfs.h
30
src/lfs.h
@@ -1,33 +1,37 @@
|
||||
/*
|
||||
** LuaFileSystem
|
||||
** Copyright Kepler Project 2003 - 2017 (http://keplerproject.github.io/luafilesystem)
|
||||
** File system manipulation library
|
||||
**
|
||||
** Copyright (C) 2003-2010 Kepler Project.
|
||||
** Copyright (C) 2010-2022 The LuaFileSystem authors.
|
||||
** (http://lunarmodules.github.io/luafilesystem)
|
||||
*/
|
||||
|
||||
/* 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"
|
||||
#define chdir(p) (-1)
|
||||
#define chdir_error "Function 'chdir' not provided by system"
|
||||
#else
|
||||
#define chdir_error strerror(errno)
|
||||
#define chdir_error strerror(errno)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define chdir(p) (_chdir(p))
|
||||
#define getcwd(d, s) (_getcwd(d, s))
|
||||
#define rmdir(p) (_rmdir(p))
|
||||
#define LFS_EXPORT __declspec (dllexport)
|
||||
#ifndef fileno
|
||||
#define fileno(f) (_fileno(f))
|
||||
#endif
|
||||
#define chdir(p) (_chdir(p))
|
||||
#define getcwd(d, s) (_getcwd(d, s))
|
||||
#define rmdir(p) (_rmdir(p))
|
||||
#define LFS_EXPORT __declspec (dllexport)
|
||||
#ifndef fileno
|
||||
#define fileno(f) (_fileno(f))
|
||||
#endif
|
||||
#else
|
||||
#define LFS_EXPORT
|
||||
#define LFS_EXPORT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
LFS_EXPORT int luaopen_lfs (lua_State *L);
|
||||
LFS_EXPORT int luaopen_lfs(lua_State * L);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ local tmp = "/tmp"
|
||||
local sep = string.match (package.config, "[^\n]+")
|
||||
local upper = ".."
|
||||
|
||||
local is_unix = package.config:sub(1,1) == "/"
|
||||
|
||||
local lfs = require"lfs"
|
||||
print (lfs._VERSION)
|
||||
|
||||
@@ -60,6 +62,8 @@ if not attrib then
|
||||
error ("could not get attributes of file `"..tmpdir.."':\n"..errmsg)
|
||||
end
|
||||
local f = io.open(tmpfile, "w")
|
||||
local data = "hello, file!"
|
||||
f:write(data)
|
||||
f:close()
|
||||
|
||||
io.write(".")
|
||||
@@ -87,14 +91,42 @@ assert (new_att.modification == testdate1, "could not set modification time")
|
||||
io.write(".")
|
||||
io.flush()
|
||||
|
||||
-- Checking link (does not work on Windows)
|
||||
if lfs.link (tmpfile, "_a_link_for_test_", true) then
|
||||
assert (lfs.attributes"_a_link_for_test_".mode == "file")
|
||||
assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
|
||||
assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile)
|
||||
assert (lfs.symlinkattributes("_a_link_for_test_", "target") == tmpfile)
|
||||
|
||||
assert (lfs.symlinkattributes(tmpfile).mode == "file")
|
||||
|
||||
assert (lfs.link (tmpfile, "_a_hard_link_for_test_"))
|
||||
assert (lfs.attributes (tmpfile, "nlink") == 2)
|
||||
assert (lfs.symlinkattributes"_a_hard_link_for_test_".mode == "file")
|
||||
|
||||
local fd = io.open(tmpfile)
|
||||
assert(fd:read("*a") == data)
|
||||
fd:close()
|
||||
|
||||
fd = io.open("_a_link_for_test_")
|
||||
assert(fd:read("*a") == data)
|
||||
fd:close()
|
||||
|
||||
fd = io.open("_a_hard_link_for_test_")
|
||||
assert(fd:read("*a") == data)
|
||||
fd:close()
|
||||
|
||||
fd = io.open("_a_hard_link_for_test_", "w+")
|
||||
local data2 = "write in hard link"
|
||||
fd:write(data2)
|
||||
fd:close()
|
||||
|
||||
fd = io.open(tmpfile)
|
||||
assert(fd:read("*a") == data2)
|
||||
fd:close()
|
||||
|
||||
if is_unix then
|
||||
assert (lfs.attributes (tmpfile, "nlink") == 2)
|
||||
end
|
||||
|
||||
assert (os.remove"_a_link_for_test_")
|
||||
assert (os.remove"_a_hard_link_for_test_")
|
||||
end
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
LIBRARY lfs.dll
|
||||
DESCRIPTION "LuaFileSystem"
|
||||
VERSION 1.2
|
||||
EXPORTS
|
||||
luaopen_lfs
|
||||
@@ -1,33 +0,0 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "luafilesystem_dll"=.\luafilesystem_dll.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
luafilesystem
|
||||
..
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="luafilesystem_dll" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=luafilesystem_dll - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "luafilesystem_dll.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "luafilesystem_dll.mak" CFG="luafilesystem_dll - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "luafilesystem_dll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "luafilesystem_dll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName "luafilesystem_dll"
|
||||
# PROP Scc_LocalPath ".."
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "luafilesystem_dll - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "../lib/vc6"
|
||||
# PROP Intermediate_Dir "luafilesystem_dll/Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../external-src/lua50/include" /I "../../compat/src" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x416 /d "NDEBUG"
|
||||
# ADD RSC /l 0x416 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 lua50.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../bin/vc6/lfs.dll" /libpath:"../../external-src/lua50/lib/dll"
|
||||
# Begin Special Build Tool
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=cd ../bin/vc6 zip.exe luafilesystem-1.2-win32.zip lfs.dll
|
||||
# End Special Build Tool
|
||||
|
||||
!ELSEIF "$(CFG)" == "luafilesystem_dll - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "../lib/vc6"
|
||||
# PROP Intermediate_Dir "luafilesystem_dll/Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../external-src/lua50/include" /I "../../compat/src" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LUAFILESYSTEM_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x416 /d "_DEBUG"
|
||||
# ADD RSC /l 0x416 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 lua50.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../bin/vc6/lfsd.dll" /pdbtype:sept /libpath:"../../external-src/lua50/lib/dll"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "luafilesystem_dll - Win32 Release"
|
||||
# Name "luafilesystem_dll - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\compat\src\compat-5.1.c"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\lfs.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\lfs.def
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE="..\..\compat\src\compat-5.1.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\src\lfs.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
Reference in New Issue
Block a user