[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to check a file's modify time is at epoch 0?
From: |
Eli Schwartz |
Subject: |
Re: How to check a file's modify time is at epoch 0? |
Date: |
Sun, 27 Oct 2019 22:00:47 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 |
On 10/27/19 7:29 PM, Peng Yu wrote:
> Thanks. But I am looking for something native to bash. Involvement
> with external programs will slow down the run time.
No, there is no bash builtin that lets you stat the filesize directly.
I was going to say, assuming your distribution of bash included the
built contents of examples/loadables/, you could use the example
loadable 'finfo'. However,
$ enable -f /usr/lib/bash/finfo finfo
-bash: enable: cannot open shared object /usr/lib/bash/finfo:
/usr/lib/bash/finfo: undefined symbol: minor
Other loadables provided in my Arch Linux package work fine, just this
one does not.
Chet -- when I try to compile finfo.c, I get this warning:
finfo.c: In function ‘printst’:
finfo.c:277:7: warning: implicit declaration of function ‘major’
[-Wimplicit-function-declaration]
277 | ma = major (st->st_rdev);
| ^~~~~
finfo.c:278:7: warning: implicit declaration of function ‘minor’
[-Wimplicit-function-declaration]
278 | mi = minor (st->st_rdev);
| ^~~~~
If I add an #include <sys/sysmacros.h> then it compiles okay and I can
load it and it works as expected.
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
signature.asc
Description: OpenPGP digital signature