mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 20:33:06 +00:00
ifdefs por conta de problemas de compilacao no windows.
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
** lfs.lock (fh, mode)
|
** lfs.lock (fh, mode)
|
||||||
** lfs.unlock (fh)
|
** lfs.unlock (fh)
|
||||||
**
|
**
|
||||||
** $Id: lfs.c,v 1.9 2004/11/03 10:11:18 tomas Exp $
|
** $Id: lfs.c,v 1.10 2004/11/04 22:21:28 tuler Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@@ -354,7 +354,11 @@ static int dir_create_meta (lua_State *L) {
|
|||||||
/*
|
/*
|
||||||
** Convert the inode protection mode to a string.
|
** Convert the inode protection mode to a string.
|
||||||
*/
|
*/
|
||||||
|
#ifdef WIN32
|
||||||
|
static const char *mode2string (unsigned short mode) {
|
||||||
|
#else
|
||||||
static const char *mode2string (mode_t mode) {
|
static const char *mode2string (mode_t mode) {
|
||||||
|
#endif
|
||||||
if ( S_ISREG(mode) )
|
if ( S_ISREG(mode) )
|
||||||
return "file";
|
return "file";
|
||||||
else if ( S_ISDIR(mode) )
|
else if ( S_ISDIR(mode) )
|
||||||
@@ -431,6 +435,7 @@ static int file_info (lua_State *L) {
|
|||||||
lua_pushliteral (L, "size");
|
lua_pushliteral (L, "size");
|
||||||
lua_pushnumber (L, (lua_Number)info.st_size);
|
lua_pushnumber (L, (lua_Number)info.st_size);
|
||||||
lua_rawset (L, -3);
|
lua_rawset (L, -3);
|
||||||
|
#ifndef WIN32
|
||||||
/* blocks allocated for file */
|
/* blocks allocated for file */
|
||||||
lua_pushliteral (L, "blocks");
|
lua_pushliteral (L, "blocks");
|
||||||
lua_pushnumber (L, (lua_Number)info.st_blocks);
|
lua_pushnumber (L, (lua_Number)info.st_blocks);
|
||||||
@@ -439,6 +444,7 @@ static int file_info (lua_State *L) {
|
|||||||
lua_pushliteral (L, "blksize");
|
lua_pushliteral (L, "blksize");
|
||||||
lua_pushnumber (L, (lua_Number)info.st_blksize);
|
lua_pushnumber (L, (lua_Number)info.st_blksize);
|
||||||
lua_rawset (L, -3);
|
lua_rawset (L, -3);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user