lfiletest

Introduction

lfiletest is a library for Lua 5.1. It supports the file testing capabilities known from shells (see `man test`).


Example

#!/usr/bin/lua
require"filetest"

value = filetest.test("-r", "somefile")

This tests the file "somefile" for readability.

Supported Functions

-e: file exists
-d: file is a directory
-f: file is regular file
-L: file is symbolic link
-r: file is readable
-w: file is writable
-x: file is executable
-O: file is owned by you
-G: file has your effective group-id
-s: file has size > 0
-u: file is set-user-id
-g: file is set-group-ID
-k: file has sticky-bit set
-b: file is >>block special<<
-c: file is >>character special<<
-p: file is named pipe
-S: file is a socket

Download

lfiletest is hosted by luaforge.net.


Comments

Please send me your comments (luaforge message formular).


Last modified: Sep 17 2007