LU-16561: find: support width in -printf directive
The width supported can be positive or negative. A negative width will align
elements on the left while positive values will align elements on the right.
We also support the 0 prefix. The man page of printf(3) indicates that the
prefix 0 should use '0' instead of spaces for padding. However, GNU-find does
not use 0 padding for all the types of values. Only '%d', '%m' and '%S' use 0
padding. This patch replicates this behavior. For instance:
$ find /mnt/lustre -printf "%13p: '%024i' '%05m'\n"
/mnt/lustre: '
144115188193296385' '00755'
/mnt/lustre/f: '
144115205272502273' '00644'
Change-Id: I954788513cc6b43c413a3688d51c1bf1efd7d9db
Signed-off-by: Courrier Guillaume <guillaume.courrier@cea.fr>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57395
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>