Next: , Previous: , Up: file   [Contents][Index]


6.3 Testing file existence and the like

When using the following functions: the optional argument PRINT_ERROR will cause an error message to be printed with mbfl_message_error() if the test fails; the argument value must be print_error.

File functions

Function: mbfl_file_exists pathname

Return true if pathname exists.

Function: mbfl_file_is_file filename
Function: mbfl_file_is_file filename PRINT_ERROR

Return true if filename is not the empty string and is a file.

Function: mbfl_file_is_readable filename
Function: mbfl_file_is_readable filename PRINT_ERROR

Return true if filename is not the empty string, is a file and is readable.

Function: mbfl_file_is_writable filename
Function: mbfl_file_is_writable filename PRINT_ERROR

Return true if filename is not the empty string, is a file and is writable.

Function: mbfl_file_is_executable filename
Function: mbfl_file_is_executable filename PRINT_ERROR

Return true if filename is not the empty string, is a file and is executable.

Directory functions

Function: mbfl_file_is_directory directory
Function: mbfl_file_is_directory directory PRINT_ERROR

Return true if directory is not the empty string and is a directory.

Function: mbfl_file_directory_is_readable directory
Function: mbfl_file_directory_is_readable directory PRINT_ERROR

Return true if directory is not the empty string, is a directory and is readable.

Function: mbfl_file_directory_is_writable directory
Function: mbfl_file_directory_is_writable directory PRINT_ERROR

Return true if directory is not the empty string, is a directory and is writable.

Function: mbfl_file_directory_is_executable directory
Function: mbfl_file_directory_is_executable directory PRINT_ERROR

Return true if directory is not the empty string, is a directory and is executable.

Function: mbfl_file_directory_validate_writability directory description

Test directory existence and writability; return true if the directory exists and is writable. If the condition is not met: Print informative messages using description to refer to the directory.

Symbolic link functions

Function: mbfl_file_is_symlink pathname
Function: mbfl_file_is_symlink pathname PRINT_ERROR

Return true if pathname is not the empty string and is a symbolic link.

Generic pathname functions

Function: mbfl_file_pathname_is_readable pathname
Function: mbfl_file_pathname_is_readable pathname PRINT_ERROR

Return true if pathname is not the empty string and is readable.

Function: mbfl_file_pathname_is_writable pathname
Function: mbfl_file_pathname_is_writable pathname PRINT_ERROR

Return true if pathname is not the empty string and is writable.

Function: mbfl_file_pathname_is_executable pathname
Function: mbfl_file_pathname_is_executable pathname PRINT_ERROR

Return true if pathname is not the empty string and is executable.


Next: , Previous: , Up: file   [Contents][Index]

This document describes version 3.0.0-devel.0 of Marcos Bash Functions Library.