suve

awful: function: file-exists

Available since rev.36 (v.0.5.0).

Declaration

bool :file-exists ( string $FILENAME , … )

Summary

Checks if path FILENAME exists in the filesystem. Multiple arguments can be used to check against several files at once.
Returns TRUE if all files exist, or FALSE otherwise.

Note that, on Linux, this function will return TRUE for directories.

Example

# :file-exists example
!if :file-exists s'.lock'
    :writeln s'Another instance is running.'
    :exit 
!fi

wikipage modified on 2014/0601/2317