mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 20:33:06 +00:00
Substituicao nos nomes dos arquivos.
This commit is contained in:
4
Makefile
4
Makefile
@@ -1,6 +1,6 @@
|
|||||||
# $Id: Makefile,v 1.1 2004/07/27 14:15:24 tomas Exp $
|
# $Id: Makefile,v 1.2 2004/07/29 14:26:33 tomas Exp $
|
||||||
|
|
||||||
T= luafilesystem
|
T= lfs
|
||||||
|
|
||||||
include ./config
|
include ./config
|
||||||
|
|
||||||
|
|||||||
4
config
4
config
@@ -1,6 +1,7 @@
|
|||||||
# Installation directories
|
# Installation directories
|
||||||
# System's libraries directory (where Lua libraries are installed)
|
# System's libraries directory (where binary libraries are installed)
|
||||||
LIB_DIR= /usr/local/lib
|
LIB_DIR= /usr/local/lib
|
||||||
|
# System's lua directory (where Lua libraries are installed)
|
||||||
LUA_DIR= /usr/local/lua
|
LUA_DIR= /usr/local/lua
|
||||||
|
|
||||||
# OS dependent
|
# OS dependent
|
||||||
@@ -10,7 +11,6 @@ LIB_OPTION= -dynamiclib #for MacOS X
|
|||||||
#LIB_OPTION= -shared #for Linux
|
#LIB_OPTION= -shared #for Linux
|
||||||
|
|
||||||
# Compilation directives
|
# Compilation directives
|
||||||
# pre-compile and include mod2.lua into mod_lua.c
|
|
||||||
# On FreeBSD systems, the following line should be commented
|
# On FreeBSD systems, the following line should be commented
|
||||||
DLLIB= -ldl
|
DLLIB= -ldl
|
||||||
WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings
|
WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
LIBRARY luafilesystem.dll
|
|
||||||
DESCRIPTION "LuaFilesystem"
|
|
||||||
VERSION 1.0
|
|
||||||
EXPORTS
|
|
||||||
luaopen_luafilesystem
|
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
/*
|
/*
|
||||||
** File system manipulation library.
|
** File system manipulation library.
|
||||||
** This library offers these functions:
|
** This library offers these functions:
|
||||||
** luafilesystem.attributes (filepath [, attributename])
|
** lfs.attributes (filepath [, attributename])
|
||||||
** luafilesystem.chdir (path)
|
** lfs.chdir (path)
|
||||||
** luafilesystem.currentdir ()
|
** lfs.currentdir ()
|
||||||
** luafilesystem.dir (path)
|
** lfs.dir (path)
|
||||||
** luafilesystem.mkdir (path)
|
** lfs.mkdir (path)
|
||||||
** luafilesystem.lock (fh, mode)
|
** lfs.lock (fh, mode)
|
||||||
** luafilesystem.unlock (fh)
|
** lfs.unlock (fh)
|
||||||
**
|
**
|
||||||
** $Id: luafilesystem.c,v 1.1 2004/07/27 14:15:24 tomas Exp $
|
** $Id: lfs.c,v 1.1 2004/07/29 14:26:33 tomas Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#include <lauxlib.h>
|
#include <lauxlib.h>
|
||||||
#include <lualib.h>
|
#include <lualib.h>
|
||||||
|
|
||||||
#include "luafilesystem.h"
|
#include "lfs.h"
|
||||||
|
|
||||||
/* Define 'strerror' for systems that do not implement it */
|
/* Define 'strerror' for systems that do not implement it */
|
||||||
#ifdef NO_STRERROR
|
#ifdef NO_STRERROR
|
||||||
@@ -344,8 +344,8 @@ static const struct luaL_reg fslib[] = {
|
|||||||
{NULL, NULL},
|
{NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
int luaopen_luafilesystem (lua_State *L) {
|
int luaopen_lfs (lua_State *L) {
|
||||||
dir_create_meta (L);
|
dir_create_meta (L);
|
||||||
luaL_openlib (L, "luafilesystem", fslib, 0);
|
luaL_openlib (L, "lfs", fslib, 0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* Define 'chdir' for systems that do not implement it */
|
/* Define 'chdir' for systems that do not implement it */
|
||||||
/* $Id: luafilesystem.h,v 1.1 2004/07/27 14:15:24 tomas Exp $ */
|
/* $Id: lfs.h,v 1.1 2004/07/29 14:26:33 tomas Exp $ */
|
||||||
#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"
|
||||||
@@ -7,4 +7,4 @@
|
|||||||
#define chdir_error strerror(errno)
|
#define chdir_error strerror(errno)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int luaopen_filesystem (lua_State *L);
|
int luaopen_lfs (lua_State *L);
|
||||||
8
t_lfs.lua
Normal file
8
t_lfs.lua
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
-- $Id: t_lfs.lua,v 1.1 2004/07/29 14:26:33 tomas Exp $
|
||||||
|
if not lfs and loadlib then
|
||||||
|
local libname = "LIB_NAME"
|
||||||
|
local libopen = "luaopen_lfs"
|
||||||
|
local init, err1, err2 = loadlib (libname, libopen)
|
||||||
|
assert (init, (err1 or '')..(err2 or ''))
|
||||||
|
init ()
|
||||||
|
end
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
-- $Id: t_luafilesystem.lua,v 1.1 2004/07/27 14:15:24 tomas Exp $
|
|
||||||
if not luafilesystem and loadlib then
|
|
||||||
local libname = "LIB_NAME"
|
|
||||||
local libopen = "luaopen_luafilesystem"
|
|
||||||
local init, err1, err2 = loadlib (libname, libopen)
|
|
||||||
assert (init, (err1 or '')..(err2 or ''))
|
|
||||||
init ()
|
|
||||||
end
|
|
||||||
5
vc6/lfs.def
Normal file
5
vc6/lfs.def
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
LIBRARY lfs.dll
|
||||||
|
DESCRIPTION "LuaFileSystem"
|
||||||
|
VERSION 1.0
|
||||||
|
EXPORTS
|
||||||
|
luaopen_lfs
|
||||||
Reference in New Issue
Block a user