Bug 56831 - ls -l columns misformatted for files with 9-digit size
ls -l columns misformatted for files with 9-digit size
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-28 11:05 EST by Need Real Name
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-24 18:03:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-11-28 11:05:09 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)

Description of problem:
If a file's size is 9 digits or longer (100MB or larger), the output 
of "ls -l" will format columns incorrectly.  The "file size" column 
doesn't have large enough width preallocated.

Version-Release number of selected component (if applicable):
fileutils-4.0x-3

How reproducible:
Always

Steps to Reproduce:
1. Create a file with size 100000000 bytes or larger.
2. Put it into a directory with other smaller files.
3. /bin/ls -l
	

Actual Results:  Look at the line for file "ccc".  It's pushed one column 
to the right.

-rw-------    1 dbarrett dbarrett   246977 Jun  1 15:18 aaa
-r--r--r--    1 dbarrett dbarrett 97621364 Nov 26 23:44 bbb
-r--r--r--    1 dbarrett dbarrett 124582824 Nov 27 16:52 ccc
-rw-r--r--    1 dbarrett dbarrett   227553 Apr 12  2001 ddd


Expected Results:  All columns should be correctly aligned.

Additional info:

$ rpm -qf /bin/ls
fileutils-4.0x-3
Comment 1 Bernhard Rosenkraenzer 2002-08-29 19:16:49 EDT
"Fixing" this isn't possible without slowing down things a lot (ls would have to
either stat every file in the directory twice - once to find the largest file to
determine the correct alignment, then again to find the actual ls output or to
stat all files and keep the results in memory).

Especially with recursive directory listings, "fixing" this either way would be
a bad idea.

Note You need to log in before you can comment on or make changes to this bug.