Bug 56831 - ls -l columns misformatted for files with 9-digit size
Summary: ls -l columns misformatted for files with 9-digit size
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-28 16:05 UTC by Need Real Name
Modified: 2007-04-18 16:38 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Need Real Name 2001-11-28 16:05:09 UTC
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 23:16:49 UTC
"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.