GNU bug report logs - #18179
stat doesn't dereference symlinked file name

Previous Next

Package: coreutils;

Reported by: Tomasz Pala <gotar <at> polanet.pl>

Date: Sun, 3 Aug 2014 09:41:01 UTC

Severity: normal

Tags: notabug

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tomasz Pala <gotar <at> polanet.pl>
To: 18179 <at> debbugs.gnu.org
Subject: bug#18179: stat doesn't dereference symlinked file name
Date: Sun, 3 Aug 2014 11:20:01 +0200
~: touch a
~: ln -s a b
~: stat -c "%n" a
a
~: stat -c "%n" b
b
~: stat -Lc "%n" b
b

the last command should return 'a'. To be more verbose:

~: stat b
  File: `b' -> `a'
  Size: 1               Blocks: 0          IO Block: 4096   symbolic link
Device: 10h/16d Inode: 60112068    Links: 1

~: stat -L b
  File: `b'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 10h/16d Inode: 60112022    Links: 1
[...]

one cannot get the righthand part of dereference only (the same applies
to %N).

-- 
Tomasz Pala <gotar <at> pld-linux.org>




This bug report was last modified 10 years and 289 days ago.

Previous Next


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