fix __(file|directory)/explorer/stat for BSDs

This commit is contained in:
ander 2019-04-12 16:03:38 +03:00
parent a4ed9e4d0e
commit 44c9d09383
2 changed files with 7 additions and 25 deletions

View file

@ -25,20 +25,12 @@ destination="/$__object_id"
os=$("$__explorer/os")
case "$os" in
"freebsd"|"netbsd"|"openbsd")
# FIXME: should be something like this based on man page, but can not test
stat -f "type: %ST
"freebsd"|"netbsd"|"openbsd"|"macosx")
stat -f "type: %HT
owner: %Du %Su
group: %Dg %Sg
mode: %Op %Sp
" "$destination"
;;
"macosx")
stat -f "type: %HT
owner: %Du %Su
group: %Dg %Sg
mode: %Lp %Sp
" "$destination"
mode: %Lp %Sp
" "$destination" | awk '/^type/ { print tolower($0); next; } { print; }'
;;
*)
stat --printf="type: %F

View file

@ -25,24 +25,14 @@ destination="/$__object_id"
os=$("$__explorer/os")
case "$os" in
"freebsd"|"netbsd"|"openbsd")
# FIXME: should be something like this based on man page, but can not test
stat -f "type: %ST
owner: %Du %Su
group: %Dg %Sg
mode: %Op %Sp
size: %Dz
links: %Dl
" "$destination"
;;
"macosx")
"freebsd"|"netbsd"|"openbsd"|"macosx")
stat -f "type: %HT
owner: %Du %Su
group: %Dg %Sg
mode: %Lp %Sp
size: %Dz
links: %Dl
" "$destination"
" "$destination" | awk '/^type/ { print tolower($0); next; } { print; }'
;;
*)
stat --printf="type: %F