io


Functions

exists(filename : string)

->boolean

Returns true when a file, folder or link at the given path and name exists

stat(filename : string)

->result : Stat?, error : string?, error_code : integer?

Returns a table with status info about the file, folder or link at the given path and name, else nil the error and the error code is returned.

chmod(filename : string, mode : integer)

->result : boolean, error : string?, error_code : integer?

Change permissions of a file, folder or link. mode is a unix permission styled octal number (like 755 - WITHOUT a leading octal 0). Executable, group and others flags are ignored on windows and won't fire errors


Local Structs

Stat

return value for io.stat


Properties

dev : integer

device number of filesystem

ino : integer

inode number

mode : integer

unix styled file permissions

type : "file" | "directory" | "link" | "socket" | "named pipe" | "char device" | "block device"

number of (hard) links to the file

uid : integer

numeric user ID of file's owner

gid : integer

numeric group ID of file's owner

rdev : integer

the device identifier (special files only)

size : integer

total size of file, in bytes

atime : integer

last access time in seconds since the epoch

mtime : integer

last modify time in seconds since the epoch

ctime : integer

inode change time (NOT creation time!) in seconds