logoalt Hacker News

metaltyphoon • yesterday at 7:35 PM • 3 replies • view on HN

This can’t be right is it?


Replies

collinfunk • yesterday at 9:56 PM

It is correct. But only 'date' and 'touch' use it, so I am not sure how much benefit there is in making it a shared library.

If size is really a concern, we have supported building a single 'coreutils' binary since 2014, which will be more effective in saving disk space. It can be done with './configure --enable-single-binary'.

➕ show 1 reply
Joker_vD • yesterday at 7:55 PM

Yes, it can be. You can run `strings "$(command -v touch)"` yourself and then compare the output with the strings in parse-datetime.y [0]. Look for e.g. "FORTNIGHT", "sixth", and "error: parsing failed, stopped at '%s'", they're all inside the touch's executable.

[0] https://github.com/coreutils/gnulib/blob/master/lib/parse-da...

➕ show 1 reply
shiandow • yesterday at 9:54 PM

Repeating the code is silly, but some degree of duplication in the binary makes sense. It's a basic size / latency trade-off.

➕ show 1 reply