Skip to content

Commit

Permalink
Run stat in empty env with C locale (#184)
Browse files Browse the repository at this point in the history
This allows for a stable output in case the target systems use a locale
with a different number format.

Signed-off-by: Tom Wieczorek <[email protected]>
(cherry picked from commit 5a14296)
  • Loading branch information
twz123 authored Mar 18, 2024
1 parent b4f7f79 commit 566086e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/rigfs/posixfsys.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ func (f *PosixFile) Seek(offset int64, whence int) (int64, error) {
}

var (
statCmdGNU = "stat -c '%%#f %%s %%.9Y //%%n//' -- %s 2> /dev/null"
statCmdBSD = "stat -f '%%#p %%z %%Fm //%%N//' -- %s 2> /dev/null"
statCmdGNU = "env -i LC_ALL=C stat -c '%%#f %%s %%.9Y //%%n//' -- %s 2> /dev/null"
statCmdBSD = "env -i LC_ALL=C stat -f '%%#p %%z %%Fm //%%N//' -- %s 2> /dev/null"
)

func (fsys *PosixFsys) initStat() error {
Expand Down

0 comments on commit 566086e

Please sign in to comment.