GNU bug report logs - #23422
stat -c %N returns strange results for file names including <TAB>

Previous Next

Package: coreutils;

Reported by: Michael Albinus <michael.albinus <at> gmx.de>

Date: Mon, 2 May 2016 09:29:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 23422 <at> debbugs.gnu.org (full text, mbox):

From: Ruediger Meier <sweet_f_a <at> gmx.de>
To: 23422 <at> debbugs.gnu.org
Subject: Re: bug#23422: stat -c %N returns strange results for file names
 including <TAB>
Date: Tue, 3 May 2016 00:19:14 +0200
On Monday 02 May 2016, Michael Albinus wrote:
> Pádraig Brady <P <at> draigBrady.com> writes:
>
> Hi,
>
> >> I have a file called "foo<TAB>bar". Yes, it includes the <TAB>
> >> char in its name. When I call "stat -c %N", I get 'foo'$'\t''bar'
> >> .
> >>
> >> This looks pretty strange. It is with "stat (GNU coreutils) 8.25".
> >> Earlier stat versions, say "stat (GNU coreutils) 6.12" on a very
> >> old machine I have access too, used to return `foo\tbar' .
> >
> > We were thinking that since %N returns the quoted file name,
> > that it would be more generally useful to return the shell quoted
> > format, as that can be copied and pasted back to a shell command.
> > For example it allows one to always paste back the file name from
> > `stat *` which includes %N in the default output.
>
> I'm using stat in Emacs/Tramp in order to retrieve information about
> files on remote hosts. The returned string is parsed then inside
> Emacs.
>
> This is broken now, and I'm really undecided whether I shall start to
> parse a shell quoted output. Likely not, if you bring this
> functionality back, somehow. For the time being, I'll disable use of
> stat in Tramp (unfortunately too late for the upcoming Emacs 25.1).
>
> Btw, neither in the stat man page nor in the NEWS file of coreutils I
> found a hint about the changed behaviour. It would be nice to
> announce such incompatible changes, somehow.

Actually it would be nice to simply _avoid_ such incompatible changes. 
This new quoting style default is just ugly, unreadable and annoying.

Please revert.

cu,
Rudi




This bug report was last modified 8 years and 253 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.