|
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base perseant-exfatfs-base-20240630 perseant-exfatfs-base
|
| 1.15 |
29-Jan-2024 |
christos |
fix tools build
|
| 1.14 |
29-Jan-2024 |
christos |
PR/57891: Ricardo Branco: add symbolic flags printing (from FreeBSD)
|
| 1.13 |
03-Jun-2023 |
lukem |
adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}
Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of the older style more complex expressions.
|
|
Revision tags: netbsd-10-1-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
|
| 1.12 |
22-Jun-2022 |
kre |
Divide stat.1 into stat.1 (now only includes stat(1)) and readlink.1
Apologies to cvs commit purists, but making this division required line by line reading of the man pages, and I simply could not resist also correcting some errors, addressing some omissions, improving some wording ... all at the same time.
|
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 phil-wifi-20191119
|
| 1.11 |
29-Sep-2019 |
mrg |
convert HAVE_GCC == 7 to HAVE_GCC >= 7.
|
|
Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
|
| 1.10 |
04-Feb-2019 |
mrg |
rework the previous to only apply if !HOSTPROG
|
| 1.9 |
04-Feb-2019 |
mrg |
apply -Wno-error=implicit-fallthrough on files that have fallthru comments but are missed by the current checker.
|
|
Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-7-base yamt-pagecache-base9 yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 tls-maxphys-base matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
|
| 1.8 |
17-Aug-2011 |
christos |
branches: 1.8.42; document non-literal format strings
|
|
Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base chap-midi-nbase netbsd-3-0-1-RELEASE chap-midi-base netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
|
| 1.7 |
25-Jul-2003 |
atatat |
More properly host-tool-ify stat
|
| 1.6 |
22-Jul-2003 |
lukem |
pass in -DHOSTPROG if a HOSTPROG
|
| 1.5 |
21-Jul-2003 |
agc |
Fix a tyop - we want the readlink binary and manual pages when HOSTPROG is not defined.
|
| 1.4 |
20-Jul-2003 |
lukem |
first attempt at making this a HOSTPROG
|
|
Revision tags: fvdl_fs64_base
|
| 1.3 |
26-Jul-2002 |
atatat |
NetBSD id police
|
| 1.2 |
08-Jul-2002 |
atatat |
A new command line option, -q, suppresses *stat(2) failure messages. Output is now done via stdio, instead of with my stupid homegrown buffering (I don't even know why I did it that way in the first place). Also, from Johan Karlsson <johan@freebsd.org>, eliminate a spurious newline if no output was generated, and link stat(1) to readlink(1) for similarity to OpenBSD.
|
|
Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
|
| 1.1 |
27-Apr-2002 |
atatat |
Add a stat(1) program to /usr/bin. It provides a simple formatting interface, with reasonable defaults, to the information provided by stat(2) so that scripts can use the data therein much more easily.
|
|
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
|
| 1.7 |
03-May-2025 |
kre |
Make readlink(1) compliant with the POSIX-2004 (Issue 8).
POSIX 2004 requires that if a given file name to readlink(1) doesn't refer to a symlink, an error be printed.
That conflicts with historic usage on NetBSD where readlink is silent in that case (except for the exit status) -- rather than altering our default behaviour, look for POSIXLY_CORRECT in the environment, and issue an error only in that case (just means switching between -q and -v as the default noise option).
While here, generate usage if no file args are given - POSIX requires at least 1 (it actually specifies exactly 1) and while we can extend that without issues to allow more than one, allowing 0 args (just because we do that for stat(1) and readlink(1) is the same code) makes no sense at all for readlink - stdin cannot possibly be a symbolic link.
Also, in the case of stat(1) if we do have no args, and the fstat(STDIN) fails for some reason, don't claim that it is lstat (or stat, depending upon -L) which failed: stat: (stdin): lstat: Bad file descriptor makes no sense at all. This can occur with something like stat <&- which is kind of obscure, but it is easy to DTRT.
No pullups planned.
|
|
Revision tags: netbsd-10-1-RELEASE perseant-exfatfs-base-20240630 perseant-exfatfs-base netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
|
| 1.6 |
21-Jul-2022 |
wiz |
branches: 1.6.4; readlink: sort SEE ALSO
|
| 1.5 |
21-Jul-2022 |
kre |
Add an Xr to realpath(1) (which does much the same as readlink -f). Try not to forget the damn comma!
|
| 1.4 |
22-Jun-2022 |
wiz |
Remove dot at end of SEE ALSO.
|
| 1.3 |
22-Jun-2022 |
uwe |
readlink(1): Add italic correction.
|
| 1.2 |
22-Jun-2022 |
uwe |
readlink(1): Add missing .El, use non-random .Bl -width
|
| 1.1 |
22-Jun-2022 |
kre |
Divide stat.1 into stat.1 (now only includes stat(1)) and readlink.1
Apologies to cvs commit purists, but making this division required line by line reading of the man pages, and I simply could not resist also correcting some errors, addressing some omissions, improving some wording ... all at the same time.
|
|
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
|
| 1.48 |
03-May-2025 |
kre |
PR bin/47333
Note that -L will fall back to use lstat() if the stat() requested returns ENOENT (if the following lstat() fails, the ENOENT from the lstat() is returned - that generally indicates that the original ENOENT came from the filename passed to stat() rather than the value of the symlink. (The man page doesn't say all of that.)
If "stat -L name" returns data from a symlink (eg: if -f %T is @) then name must refer to a symlink which points to nothing. (The man page does say that.)
|
|
Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
|
| 1.47 |
29-Jan-2024 |
christos |
branches: 1.47.2; PR/57891: Ricardo Branco: add symbolic flags printing (from FreeBSD)
|
|
Revision tags: netbsd-10-1-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
|
| 1.46 |
24-Jun-2022 |
kre |
Remove the notge (I added a day or so ago) about IFS interfering with -s output (potentially) - it is almost certainly wrong.
|
| 1.45 |
23-Jun-2022 |
uwe |
stat(1): Fix two more -width.
|
| 1.44 |
22-Jun-2022 |
uwe |
stat(1): Misc fixes.
|
| 1.43 |
22-Jun-2022 |
wiz |
Use \(em, fix macro usage
|
| 1.42 |
22-Jun-2022 |
kre |
Some corrections to stat to make it more reasonable, and comply with the man page, in particular, in one of the EXAMPLES it is claimed:
This example produces output very similar to that from find ... -ls (except that find(1) displays the time in a different format, and find(1) sometimes adds one or more spaces after the comma in “major,minor” for device nodes):
and then uses %9Z in the format, but conveniently does not use a device file to demonstrate.
If it had, the result would have been:
8033 0 brw-r----- 1 root operator 4, 51 Jun 8 02:44:45 2022 /dev/sd3
Note the spaces which were claimed to exist (sometimes) in find(1) output but not with stat. Oops.
Omitting those spaces seems like a good idea, so does using the same field width for the result in both cases, rather than producing 9 chars in the ordinary file case, and 19 (2 * 9 + 1) in the device case (for %9Z).
Now we will get:
8033 0 brw-r----- 1 root operator 4,51 Jun 8 02:44:45 2022 /dev/sd3
While here, also make the file number (%@) when reading stdin be 0, it is not the 1st file in the arg list.
Some (very minor) KNF applied at the same time.
In stat.1 make these changes explicit.
|
| 1.41 |
22-Jun-2022 |
kre |
Divide stat.1 into stat.1 (now only includes stat(1)) and readlink.1
Apologies to cvs commit purists, but making this division required line by line reading of the man pages, and I simply could not resist also correcting some errors, addressing some omissions, improving some wording ... all at the same time.
|
|
Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
|
| 1.40 |
20-Sep-2017 |
wiz |
whitespace fixes, use Xr.
|
| 1.39 |
19-Sep-2017 |
christos |
- if st_dev/st_rdev == NODEV print -1 instead of unsigned - update to the latest linux stat(1) format for -x (kind of) - add the ability to display nanoseconds, like linux does - change u_intX_t -> uintX_t
|
|
Revision tags: perseant-stdc-iso10646-base
|
| 1.38 |
03-Jul-2017 |
wiz |
Remove workaround for ancient HTML generation code.
|
|
Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE matt-nb8-mediatek-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base tls-maxphys-base
|
| 1.37 |
13-Apr-2014 |
snj |
Change some standard exit status text to ".Ex -std" From Eitan Adler in PR bin/47790.
|
|
Revision tags: riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7
|
| 1.36 |
03-Dec-2012 |
wiz |
branches: 1.36.6; Bump date for previous. Remove trailing whitespace.
|
| 1.35 |
02-Dec-2012 |
erh |
Honor the -t option to set the time format when running stat -s. Document the format used by -s on the man page.
|
|
Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
|
| 1.34 |
22-Sep-2011 |
apb |
branches: 1.34.2; 1.34.8; Use vis(3) encoding when a string format is modified by the '#' flag. Also bump copyright years.
|
| 1.33 |
16-Sep-2011 |
apb |
More corrections to format compatibility between stat(1), find(1) -ls, and ls(1) -lT.
|
| 1.32 |
16-Sep-2011 |
wiz |
Remove unnecessary Ns.
|
| 1.31 |
16-Sep-2011 |
apb |
Anothe difference in output format: stat -f "%Z" does not add any space in "major,minor" for device nodes, whereas both "ls -l" and "find -ls" add at least one space.
|
| 1.30 |
15-Sep-2011 |
apb |
Add examples of formats for stat(1) to simulate "find -ls" and "ls -lTd".
|
|
Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base
|
| 1.29 |
16-Feb-2011 |
christos |
Add verbose mode for readlink.
|
|
Revision tags: matt-mips64-premerge-20101231
|
| 1.28 |
05-Apr-2010 |
joerg |
branches: 1.28.2; \\ -> \e
|
| 1.27 |
11-Mar-2010 |
enami |
Since we have st_birthtime in struct stat, it is in default display.
|
|
Revision tags: matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
|
| 1.26 |
07-Nov-2008 |
wiz |
Drop trailing space.
|
| 1.25 |
07-Nov-2008 |
reed |
Be consistent: document the birthtime field of struct stat for the "B" field specifier.
|
|
Revision tags: netbsd-5-base matt-mips64-base2
|
| 1.24 |
20-Oct-2008 |
wiz |
branches: 1.24.2; Fix three variable names. From Todd T. Fries via Jason McIntyre.
|
|
Revision tags: wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
|
| 1.23 |
30-Apr-2008 |
martin |
Convert TNF licenses to new 2 clause variant
|
|
Revision tags: yamt-pf42-baseX yamt-pf42-base keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
|
| 1.22 |
10-Nov-2007 |
atatat |
branches: 1.22.6; Put back the NetBSD tag
|
| 1.21 |
07-Nov-2007 |
wiz |
Document the flags displayed by the default format, and mention their short names. From espie@openbsd via jmc@openbsd.
|
| 1.20 |
07-Nov-2007 |
wiz |
Make sentence easier to parse. From jsing@openbsd via jmc@openbsd.
|
|
Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-mips64-base wrstuden-fixsa-base netbsd-4-base
|
| 1.19 |
07-Oct-2006 |
elad |
branches: 1.19.8; 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!
|
|
Revision tags: abandoned-netbsd-4-base chap-midi-nbase chap-midi-base
|
| 1.18 |
26-Jun-2005 |
wiz |
Sort SEE ALSO. Drop trailing space.
|
| 1.17 |
23-Jun-2005 |
atatat |
Bend the 'L', 'M', and 'H' modifiers to work on the size, whereby it is rounded to the nearest kilobyte, megabyte, or gigabyte. Implemented at lukem's request since some things can't deal with overly large numbers when files are really large.
Have to do something like humanize_number(3), but that interface isn't really what I'm looking for. I think. More examination required.
|
| 1.16 |
04-Apr-2005 |
wiz |
Some fixes from jmc@openbsd.
|
|
Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
|
| 1.15 |
08-Jan-2005 |
yamt |
correct examples.
|
| 1.14 |
31-Dec-2004 |
atatat |
Add "dirname"- and "basename"-like functionality to stat(1) by way of the "high" and "low" selectors on the filename.
|
| 1.13 |
01-Sep-2004 |
wiz |
Sort options. Use more mdoc macros. Some nit fixes. Bump date.
|
| 1.12 |
01-Sep-2004 |
yamt |
document default format.
|
|
Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
|
| 1.11 |
08-May-2003 |
wiz |
Bump date for last.
|
| 1.10 |
08-May-2003 |
atatat |
Add %B to print the st_birthtime of an inode (adjusting the "raw" format and "shell" format appropriately), and rename the st_*timespec fields in the shell-style output to be st_*time, since that's what they really are.
|
| 1.9 |
21-Feb-2003 |
atatat |
Fix the sample output in one of the examples
|
| 1.8 |
14-Feb-2003 |
grant |
The correct capitalisation of 'NetBSD.org' is (you guessed it) 'NetBSD.org'.
some mdoc fixes.
|
|
Revision tags: fvdl_fs64_base
|
| 1.7 |
30-Sep-2002 |
grant |
New sentence, new line.
|
| 1.6 |
13-Aug-2002 |
atatat |
Style sync with FreeBSD. Changes via Doug Barton <DougB@FreeBSD.org>.
|
| 1.5 |
08-Jul-2002 |
atatat |
A new command line option, -q, suppresses *stat(2) failure messages. Output is now done via stdio, instead of with my stupid homegrown buffering (I don't even know why I did it that way in the first place). Also, from Johan Karlsson <johan@freebsd.org>, eliminate a spurious newline if no output was generated, and link stat(1) to readlink(1) for similarity to OpenBSD.
|
|
Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
|
| 1.4 |
09-May-2002 |
atatat |
Add a simple format that translates to the current file number, fix an off by one error, and #define a bunch more things to make it clearer.
|
| 1.3 |
28-Apr-2002 |
wiz |
Formatting, grammar, spelling, and other improvements.
|
| 1.2 |
28-Apr-2002 |
atatat |
That should be "ls -lTd", not "ls -lT"
|
| 1.1 |
27-Apr-2002 |
atatat |
Add a stat(1) program to /usr/bin. It provides a simple formatting interface, with reasonable defaults, to the information provided by stat(2) so that scripts can use the data therein much more easily.
|
|
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
|
| 1.55 |
15-May-2025 |
nia |
stat(1): Eliminate a compiler warning
This code at the moment is a bit magical, as it uses pointer arithemtic on a string and boolean type to return either "lstat" or "stat".
Use the ternary operator instead to make the code easier to read and make Clang happier.
No functional change intended(tm).
|
| 1.54 |
03-May-2025 |
kre |
Make readlink(1) compliant with the POSIX-2004 (Issue 8).
POSIX 2004 requires that if a given file name to readlink(1) doesn't refer to a symlink, an error be printed.
That conflicts with historic usage on NetBSD where readlink is silent in that case (except for the exit status) -- rather than altering our default behaviour, look for POSIXLY_CORRECT in the environment, and issue an error only in that case (just means switching between -q and -v as the default noise option).
While here, generate usage if no file args are given - POSIX requires at least 1 (it actually specifies exactly 1) and while we can extend that without issues to allow more than one, allowing 0 args (just because we do that for stat(1) and readlink(1) is the same code) makes no sense at all for readlink - stdin cannot possibly be a symbolic link.
Also, in the case of stat(1) if we do have no args, and the fstat(STDIN) fails for some reason, don't claim that it is lstat (or stat, depending upon -L) which failed: stat: (stdin): lstat: Bad file descriptor makes no sense at all. This can occur with something like stat <&- which is kind of obscure, but it is easy to DTRT.
No pullups planned.
|
|
Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
|
| 1.53 |
14-Mar-2024 |
rillig |
branches: 1.53.2; stat: don't allow numeric formatting flags on strings
Calling snprintf with "%+s" invokes undefined behavior.
|
| 1.52 |
14-Mar-2024 |
kre |
While the change in 1.51 certainly retained binary compat with what was in 1.50 (while silencing LINT) - it was clearly not the correct change to make. The code used !FLAG_POUND where it clearly meant ~FLAG_POUND ... the former is 0, so &= 0 could be replaced by =0 changing nothing. But that's not what it should have been doing, other flags should not have been removed here, just FLAG_POUND.
This problem seems to have existed since support for %#s was first added in 2011, which kind of suggests how rarely that format, particularly with other flags (like %#-s) has ever been used (with no other flags, the bug would not be noticed).
|
| 1.51 |
14-Mar-2024 |
rillig |
stat: fix lint warning about constant argument to '!'
No binary change.
|
| 1.50 |
29-Jan-2024 |
christos |
fix tools build
|
| 1.49 |
29-Jan-2024 |
christos |
PR/57891: Ricardo Branco: add symbolic flags printing (from FreeBSD)
|
|
Revision tags: netbsd-10-1-RELEASE netbsd-10-0-RELEASE netbsd-10-0-RC6 netbsd-10-0-RC5 netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
|
| 1.48 |
22-Jun-2022 |
kre |
Some corrections to stat to make it more reasonable, and comply with the man page, in particular, in one of the EXAMPLES it is claimed:
This example produces output very similar to that from find ... -ls (except that find(1) displays the time in a different format, and find(1) sometimes adds one or more spaces after the comma in “major,minor” for device nodes):
and then uses %9Z in the format, but conveniently does not use a device file to demonstrate.
If it had, the result would have been:
8033 0 brw-r----- 1 root operator 4, 51 Jun 8 02:44:45 2022 /dev/sd3
Note the spaces which were claimed to exist (sometimes) in find(1) output but not with stat. Oops.
Omitting those spaces seems like a good idea, so does using the same field width for the result in both cases, rather than producing 9 chars in the ordinary file case, and 19 (2 * 9 + 1) in the device case (for %9Z).
Now we will get:
8033 0 brw-r----- 1 root operator 4,51 Jun 8 02:44:45 2022 /dev/sd3
While here, also make the file number (%@) when reading stdin be 0, it is not the 1st file in the arg list.
Some (very minor) KNF applied at the same time.
In stat.1 make these changes explicit.
|
| 1.47 |
27-Aug-2021 |
rillig |
stat: fix undefined behavior when calling ctype functions
lint says: warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342]
|
|
Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
|
| 1.46 |
07-Sep-2020 |
mrg |
avoid a GCC stringop truncate warning.
|
|
Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 phil-wifi-20191119
|
| 1.45 |
04-Oct-2019 |
mrg |
adjust fallthru comment.
|
|
Revision tags: netbsd-9-4-RELEASE netbsd-9-3-RELEASE netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609
|
| 1.44 |
04-Feb-2019 |
mrg |
avoid a potential buffer truncation.
|
|
Revision tags: pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
|
| 1.43 |
21-Sep-2017 |
kre |
branches: 1.43.4; Handle the new %f (as an addition to the strftime format - -t arg) correctly, in particular %%f does not contain the %f format, and like all strftime conversions, %f can occur more than once (not that it is likely to happen, but just in case...)
|
| 1.42 |
21-Sep-2017 |
kre |
KNF, and since this gets compiled as a tool, avoid C99 declarations.
|
| 1.41 |
20-Sep-2017 |
kre |
Set the default time format for linux mode (-x) in the correct place, so it only applies to -x (in particular, not to -s) and only if another time format has not been explicitly selected (earlier in the arg list).
With luck, this will make lots of tests, which depended upon "stat -s" actually generating correct sh assignment statements, go back to working again.
|
| 1.40 |
20-Sep-2017 |
christos |
- add the sticky bits to mode - fix linux Birth for the havenots code review via email from @@@
|
| 1.39 |
19-Sep-2017 |
christos |
- if st_dev/st_rdev == NODEV print -1 instead of unsigned - update to the latest linux stat(1) format for -x (kind of) - add the ability to display nanoseconds, like linux does - change u_intX_t -> uintX_t
|
|
Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-7-2-RELEASE netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 tls-maxphys-base
|
| 1.38 |
03-Jan-2013 |
dsl |
Unset HAVE_DEVNAME for tools build. config only checks for the symbol in libc, we need the correct prototype. Which is excluded even on NetBSD (_NETBSD_SOURCE isn't defined in stdlib.h).
|
|
Revision tags: yamt-pagecache-base7
|
| 1.37 |
02-Dec-2012 |
erh |
Honor the -t option to set the time format when running stat -s. Document the format used by -s on the man page.
|
|
Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
|
| 1.36 |
22-Sep-2011 |
apb |
branches: 1.36.2; 1.36.8; Use vis(3) encoding when a string format is modified by the '#' flag. Also bump copyright years.
|
| 1.35 |
06-Sep-2011 |
joerg |
static + __dead
|
|
Revision tags: cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base
|
| 1.34 |
16-Feb-2011 |
christos |
Add verbose mode for readlink.
|
| 1.33 |
15-Jan-2011 |
njoly |
branches: 1.33.2; Do not crash if a date cannot be represented (localtime returning NULL), use the Epoch value instead.
|
|
Revision tags: matt-mips64-premerge-20101231
|
| 1.32 |
16-Dec-2010 |
dholland |
Don't pass unused argument. From Doug Barton.
|
| 1.31 |
16-Dec-2010 |
dholland |
Use strlcpy, not strncpy, when the desired semantics are strlcpy's rather than strncpy's.
|
| 1.30 |
25-Nov-2010 |
dholland |
Improve previous with comments.
|
| 1.29 |
24-Nov-2010 |
dholland |
Don't printf time_t with %d; fixes PR 44128 from yamt. With this change it successfully prints mtimes after 2038.
|
|
Revision tags: matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
|
| 1.28 |
13-Apr-2009 |
lukem |
Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)
|
|
Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-base2 wrstuden-revivesa-base
|
| 1.27 |
16-May-2008 |
atatat |
branches: 1.27.6; The ofmt variable is actually a bit mask (not the character that was in the format string) so that we can "or" it with the bits in the formats variable. This fixes the missing " -> " in front of the real path (when you use %SR).
Also, the ?: needs another space.
|
| 1.26 |
28-Apr-2008 |
martin |
branches: 1.26.2; Remove clause 3 and 4 from TNF licenses
|
|
Revision tags: yamt-pf42-baseX yamt-pf42-base keiichi-mipv6-nbase keiichi-mipv6-base matt-armv6-nbase hpcarm-cleanup-base
|
| 1.25 |
09-Feb-2008 |
mlelstv |
branches: 1.25.4; Fix a segfault when doing 'stat -f %R' on the stdin file handle, instead fake the filename '(stdin)' like the %N format.
|
|
Revision tags: netbsd-4-0-1-RELEASE matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base netbsd-4-base
|
| 1.24 |
07-Oct-2006 |
elad |
branches: 1.24.2; 1.24.4; 1.24.8; 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!
|
|
Revision tags: abandoned-netbsd-4-base chap-midi-nbase chap-midi-base
|
| 1.23 |
23-Jun-2005 |
atatat |
Bend the 'L', 'M', and 'H' modifiers to work on the size, whereby it is rounded to the nearest kilobyte, megabyte, or gigabyte. Implemented at lukem's request since some things can't deal with overly large numbers when files are really large.
Have to do something like humanize_number(3), but that interface isn't really what I'm looking for. I think. More examination required.
|
| 1.22 |
22-Apr-2005 |
atatat |
Fix a trivial truncation case, and eliminate a corner case that might print a nul character.
|
|
Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
|
| 1.21 |
13-Jan-2005 |
jmc |
Now that tools/compat provides a check, make sure st_birthtimensec exists before using it
|
| 1.20 |
31-Dec-2004 |
atatat |
Add "dirname"- and "basename"-like functionality to stat(1) by way of the "high" and "low" selectors on the filename.
|
| 1.19 |
20-Jun-2004 |
jmc |
Completely rework how tools/compat is done. Purge all uses/references to _NETBSD_SOURCE as this makes cross building from older/newer versions of NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to only use POSIX code in all places (or when reasonable test w. configure and provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86 NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
|
| 1.18 |
28-May-2004 |
atatat |
If using stat (the -L flag) and it fails, fall back to lstat(). It may be the case that we're examining a broken symlink, and anything is better than nothing.
|
|
Revision tags: netbsd-2-0-base
|
| 1.17 |
29-Oct-2003 |
atatat |
branches: 1.17.2; Take the time to set gottime so that you don't have to waste time trying to figure out why the time isn't the time you expected all the time.
|
| 1.16 |
27-Oct-2003 |
lukem |
be consistent using #if HAVE_STRUCT_STAT_ST_xxx (versus #ifdef)
|
| 1.15 |
27-Oct-2003 |
lukem |
Overhaul how `build.sh tools' are used:
* Rename "config.h" to "nbtool_config.h" and HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H. This makes in more obvious in the source when we're using tools/compat/config.h versus "standard autoconf" config.h
* Consistently move the inclusion of nbtool_config.h to before <sys/cdefs.h> so that the former can provide __RCSID() (et al), and there's no need to protect those macros any more.
These changes should make it easier to "tool-ify" a program by adding: #if HAVE_NBTOOL_CONFIG_H #include "nbtool_config.h" #endif to the top of the source files (for the general case).
|
| 1.14 |
26-Oct-2003 |
chs |
fix for systems which don't have st_*timespec. PR 23214.
|
| 1.13 |
25-Jul-2003 |
atatat |
More properly host-tool-ify stat
|
| 1.12 |
23-Jul-2003 |
lukem |
* don't compile in support for st_birth #ifdef HOSTPROG * remove %B (birth) from default format strings, since %B isn't available #ifdef HOSTPROG, and it's not standard enough to be fussed about anyway
|
| 1.11 |
20-Jul-2003 |
lukem |
first attempt at making this a HOSTPROG
|
| 1.10 |
08-May-2003 |
atatat |
Add %B to print the st_birthtime of an inode (adjusting the "raw" format and "shell" format appropriately), and rename the st_*timespec fields in the shell-style output to be st_*time, since that's what they really are.
|
|
Revision tags: fvdl_fs64_base
|
| 1.9 |
19-Oct-2002 |
provos |
use readlink with bufsize - 1; approved thorpej.
|
| 1.8 |
13-Aug-2002 |
atatat |
Use limits.h instead of sys/syslimits.h since it's more potrable.
|
| 1.7 |
13-Aug-2002 |
atatat |
Style sync with FreeBSD. Changes via Doug Barton <DougB@FreeBSD.org>.
|
| 1.6 |
09-Jul-2002 |
atatat |
Header reorganization makes a shorter list. From Doug Barton <DougB@FreeBSD.org>
|
| 1.5 |
09-Jul-2002 |
atatat |
The bitwise or-ing together of letters is almost *guaranteed* to do the wrong thing, as in this case. I should read the preprocessor output more often.
|
| 1.4 |
08-Jul-2002 |
atatat |
A new command line option, -q, suppresses *stat(2) failure messages. Output is now done via stdio, instead of with my stupid homegrown buffering (I don't even know why I did it that way in the first place). Also, from Johan Karlsson <johan@freebsd.org>, eliminate a spurious newline if no output was generated, and link stat(1) to readlink(1) for similarity to OpenBSD.
|
| 1.3 |
31-May-2002 |
atatat |
When asked for the string representation of a device that isn't found by devname(3), don't report a "bad format"...just use "???" instead.
|
|
Revision tags: netbsd-1-6-base
|
| 1.2 |
09-May-2002 |
atatat |
branches: 1.2.2; Add a simple format that translates to the current file number, fix an off by one error, and #define a bunch more things to make it clearer.
|
| 1.1 |
27-Apr-2002 |
atatat |
Add a stat(1) program to /usr/bin. It provides a simple formatting interface, with reasonable defaults, to the information provided by stat(2) so that scripts can use the data therein much more easily.
|