[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8578: 8.12 and 8.10 'ls -dl' appends ' ' (0x20: space) to file outpu

From: Eric Blake
Subject: bug#8578: 8.12 and 8.10 'ls -dl' appends ' ' (0x20: space) to file output lines
Date: Thu, 28 Apr 2011 13:16:53 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9

tag 8578 notabug
close 8578

On 04/28/2011 12:34 PM, Jason Vas Dias wrote:
> I do:
> $ ls --version | grep '[(]G'
> ls (GNU coreutils) 8.12

Thanks for the report.

> $ ls -dl /. | od -cx

od -cx is not always the best choice in formatting - it depends on the
endianness of your machine since it groups two bytes at a time.  I
personally like 'od -c -tx1z' better for the type of output you are wanting.

> 0000000   d   r   w   x   r   -   x   r   -   x   .       2   5       r
>            7264    7877    2d72    7278    782d    202e    3532    7220
> 0000020   o   o   t       r   o   o   t       4   0   9   6       A   p
>            6f6f    2074    6f72    746f    3420    3930    2036    7041
> 0000040   r       2   0       1   5   :   2   8       /   .  \n
>            2072    3032    3120    3a35    3832    2f20    0a2e
> 0000056
> Please could the ls developer let me know if it 100% POSIXLY correct
> that ls appends 0x20 to the filename '/.'  here ?

What trailing space?  Your output ended in space, slash, dot, newline,
with no trailing 0x20.  The half-word 2f20 in od -x output means that
space (20) comes _before_ slash (2f) on your little-endian machine, not

If you actually have a case where ls results in trailing space, then
yes, that's a bug we'd like to fix, but you haven't demonstrated that.
But you are right that POSIX does not permit a trailing space after the
file name in -l output.

> I believe confusion over this issue is at the root of Python bug #11946 : 
> http://bugs.python.org/issue11946
> because Python isn't handling the trailing space.

I'm afraid you're chasing after a wild goose.  ls isn't outputting a
trailing space in the first place, so this can't be the cause of your
python issues.

I'm marking this bug closed for now; you can reopen it if you can
demonstrate an actual bug with trailing space.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]