svn commit: r216204 - head/usr.bin/stat

Doug Barton dougb at
Sun Dec 5 21:17:03 UTC 2010

Author: dougb
Date: Sun Dec  5 21:17:02 2010
New Revision: 216204

  Bring in the update from NetBSD 1.19, the documentation of readlink -f
  "PR/34662: martijnb at atlas dot ipv6 dot stack dot nl: readlink doesn't
  grok -f, and there's no alternative (+fix)
  Patch applied with minor tweak (%y -> %R, as it was already taken) plus
  some nits from myself. Thanks!"
  Obtained from:	elad at


Modified: head/usr.bin/stat/stat.1
--- head/usr.bin/stat/stat.1	Sun Dec  5 21:11:45 2010	(r216203)
+++ head/usr.bin/stat/stat.1	Sun Dec  5 21:17:02 2010	(r216204)
@@ -1,4 +1,4 @@
-.\"	$NetBSD: stat.1,v 1.11 2003/05/08 13:07:10 wiz Exp $
+.\"	$NetBSD: stat.1,v 1.19 2006/10/07 10:41:50 elad Exp $
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -43,7 +43,7 @@
 .Op Fl t Ar timefmt
 .Op Ar
 .Nm readlink
-.Op Fl n
+.Op Fl fn
 .Op Ar
@@ -60,9 +60,20 @@ displays information about the file desc
 When invoked as
 .Nm readlink ,
 only the target of the symbolic link is printed.
-If the given argument is not a symbolic link,
+If the given argument is not a symbolic link and the
+.Fl f
+option is not specified,
 .Nm readlink
 will print nothing and exit with an error.
+If the
+.Fl f
+option is specified, the output is canonicalized by following every symlink
+in every component of the given path recursively. 
+.Nm readlink
+will resolve both absolute and relative paths, and return the absolute pathname
+corresponding to
+.Ar file .
+In this case, the argument does not need to be a symbolic link.
 The information displayed is obtained by calling
 .Xr lstat 2
@@ -374,13 +385,15 @@ User defined flags for
 Inode generation number.
-The following four field specifiers are not drawn directly from the
+The following five field specifiers are not drawn directly from the
 data in
 .Vt "struct stat" ,
 but are:
 .Bl -tag -width indent
 .It Cm N
 The name of the file.
+.It Cm R
+The absolute pathname corresponding to the file.
 .It Cm T
 The file type, either as in
 .Nm ls Fl F

More information about the svn-src-all mailing list