bug-coreutils
[Top][All Lists]
Advanced

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

ls --dereference


From: Nobuyuki Tsuchimura
Subject: ls --dereference
Date: Tue, 19 Dec 2006 08:38:17 +0900

  Hi, coreutils team

  Since coreutils-6.3, the behaver of 'ls -L (--dereference)'
seem to have changed.  'ls -L' doesn't follow symbolic link,
even though 'ls -Lt' follows.
Till coreutils-5.97, both 'ls -L' and 'ls -Lt' followed.

  I found the following commitment made this change.
http://cvs.savannah.gnu.org/viewcvs/coreutils/src/ls.c?root=coreutils&r1=1.405&r2=1.406

  I'm not sure the new behaver is a bug or not,
but it seems to be easy to reverse by an attached patch
(if there is no side effect).
In my opinion it is a bug, so I'll be glad if it is fixed.

--- coreutils-6.7/src/ls.c.orig 2006-11-27 19:25:51.000000000 +0900
+++ coreutils-6.7/src/ls.c      2006-12-17 23:48:31.000000000 +0900
@@ -1218,6 +1218,7 @@
 
   format_needs_stat = sort_type == sort_time || sort_type == sort_size
     || format == long_format
+    || dereference == DEREF_ALWAYS
     || print_block_size;
   format_needs_type = (! format_needs_stat
                       && (recursive

Sample operation:

% cd coreutils-6.7/src/
% mkdir foo
% mkdir bar
% ln -s ../bar foo

  <<new behaver>>
% ./ls --version
ls (GNU coreutils) 6.7
.... (snip)
% ./ls -F foo
bar@
% ./ls -FR foo
foo:
bar@
% ./ls -FRL foo
foo:
bar@            <-- doesn't follow sym-link
% ./ls -FRLt foo
foo:
bar/            <-- combination with 't' let follow

foo/bar:

  <<old behaver>>
% \ls --version
ls (fileutils) 4.1
.... (snip)
% \ls -F foo
bar@
% \ls -FR foo
foo:
bar@
% \ls -FRL foo
foo:
bar/            <-- only '-L' let follow

foo/bar:

-- Best regards,
Nobuyuki Tsuchimura




reply via email to

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