B.1.2 Acquiring attributes of files and directories

We usually want to acquire file system attributes from the file system itself, for example:

mbfl_declare_assoc_array_varref(LOGFILE)

mbflutils_file_init_file_struct mbfl_datavar(LOGFILE) \
  '/var/log/software.log' 'log file for software'

mbflutils_file_stat mbfl_datavar(LOGFILE)

"mbfl_slot_ref(LOGFILE,OWNER)"  ⇒ root
"mbfl_slot_ref(LOGFILE,GROUP)"  ⇒ root
"mbfl_slot_ref(LOGFILE,MODE)"   ⇒ 0640
Function: mbflutils_file_stat ARRYNAME

Acquire the attributes of an existent file system entry as specified in the symbolic array variable whose name is ARRYNAME; the array must have been previously declared with one of the mbflutils_file_init_*_struct() functions.

The following keys are set, or reset, by this function reading the values from the file system:

OWNER

A string representing the owner of the file system entry.

GROUP

A string representing the group of the file system entry.

MODE

A string representing the access permissions mode of the file system entry.


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