Skip to content
Márk Török edited this page Jul 15, 2020 · 3 revisions

Files

is_file

It returns 0 if file is regular file otherwise it returns 1.
Precondition : it requires the path of the file
Example : files is_file /home/mark/.bashrc

is_dir

It returns 0 if path is directory otherwise it returns 1.
Precondition : it requires the path of the dir
Example : files is_dir /home

exist

It returns 0 if path exists otherwise it returns 1.
Precondition : it requires the path of the file
Example : files exist /home
Note : The path can be any file (node, socket, regular file, binary, or dictionary)

is_symlink

It returns 0 if file is symlink otherwise it returns 1.
Precondition : it requires the path of the file
Example : files is_symlink /home/mark/lnk

is_socket

It returns 0 if file is socket otherwise it returns 1.
Precondition : it requires the path of the file
Example : files is_socket snapd.socket

is_readable

It returns 0 if file is readable otherwise it returns 1.
Precondition : it requires the path of the file
Example : files is_file /home/mark/.bashrc

is_writable

It returns 0 if file is writable otherwise it returns 1.
Precondition : it requires the path of the file
Example : files is_file /home/mark/.bashrc

is_executable

It returns 0 if file is executable otherwise it returns 1.
Precondition : it requires the path of the file
Example : files is_file /home/mark/.bashrc

Clone this wiki locally