Lua:Neutrino-API:empty:en

Aus TuxBoxWIKI
Wechseln zu: Navigation, Suche

empty

Checks if a file is empty. If it is a symbolic link, the linked file is evaluated.

Possible Error Conditions:

  • The specified path does not exist.
  • The path does not point to a regular file.
  • A symbolic link points to a non-existent file.
  • The path points to a symbolic link whose target is not a regular file.
  • Access errors occur, e.g., missing permissions to read the file.


Return value: Boolean

empty(Parameter) ab API v1.97   -   Neutrino Git


Parameter:

Parameter Typ Description/Beschreibung
1 string Object Path to the file to be checked
en: Parameters with default-values are optional. If not needed, no definition is required. In case of missing parameter, default value is used.

de: Parameter mit Default-Wert sind optional. dh. sie müssen nicht angegeben werden. Falls der Parameter fehlt, wird automatisch dieser Wert angenommen.


Example:

local fh = filehelpers.new()

-- Check if /tmp/info.txt is empty:
local x = fh:empty("/tmp/info.txt")
-- Return value true