Skip to content

Commit

Permalink
Run stat in empty env with C locale
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]>
  • Loading branch information
twz123 committed Mar 14, 2024
1 parent 05c65ac commit 5a14296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions remotefs/posixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ var (
_ fs.FS = (*PosixFS)(nil)
_ FS = (*PosixFS)(nil)
errInvalid = errors.New("invalid")
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"
)

const (
Expand Down

0 comments on commit 5a14296

Please sign in to comment.