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


6.2.1 Listing directory entries

Function: mbfl_file_enable_listing

Declare the commands required to retrieve informations about files and directories. Declaring the intention to use a program

The programs are: ls, readlink.

Function: mbfl_file_listing pathname

Execute ls with pathname as argument.

Function: mbfl_file_long_listing pathname

Execute ls with pathname as argument and the flag -l.

Function: mbfl_file_normalise_link pathname

Make use of the readlink to normalise the pathname of a symbolic link (remember that a symbolic link references a file, never a directory). Echo to stdout the normalised pathname.

The command line of readlink is:

readlink -fn "$pathname"
Function: mbfl_file_read_link pathname

Make use of readlink to acquire the original pathname referenced by pathname, then print it.

Function: mbfl_exec_readlink PATHNAME [opt …]

Raw executor for readlink. The mandatory argument PATHNAME must be the pathname of a directory entry. The optional arguments are added, as options, to the command line of readlink.


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

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