standard.C.io.filetype

filetype is available since version 1.0.

Prototype:

number filetype(string path)

Parameters

path
[in] A string containing the path of existing file.

Description:

Gets the type of a file. Is equivalent to the _stat function as this: _stat(path)["st_mode"] & S_IFMT.

Return value:

Returns the type of a file.