sys.fsentry(entry)

Get a filesystem entry by name or fullpath.

Parameters

entry

A string representing a filesystem entry name (ie a file name, or a folder name)

Return value

Returns a File or Directory instance that represents the filesystem entry. If the entry doesn't exists, it returns nil.

Example

local console = require "console" local name = console.readln("Enter an entry name : ") local entry = sys.fsentry(name) if not entry then print("'"..name.."'".." doesn't exists !") else print("'"..name.."'".." is a "..type(entry)) end