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


6.2.2 Inspecting files and directories

The GNU Coreutils package comes with a command line program stat which implements advanced inspection of file and directory status. See (coreutils)Report file or file system status.

Function: mbfl_file_enable_stat

Declare the intention to use the program stat.

Function: mbfl_file_stat pathname [opt …]
Function: mbfl_file_stat_var _RV pathname [opt …]

Execute stat with pathname as first argument and arg as other arguments.

mbfl_file_enable_stat

mbfl_file_stat /bin/ls --format='%F'
⇒ 0
-| regular

mbfl_file_stat /bin --format='%F'
⇒ 0
-| directory

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.

Function: mbfl_file_get_size pathname
Function: mbfl_file_get_size_var _RV pathname

Print the size of the file in bytes.

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.


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

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