[Info-vax] Hard links on VMS ODS5 disks
Steven Schweda
sms.antinode at gmail.com
Wed Jul 12 18:46:43 EDT 2023
> [...] For example, gzip, gunzip, zcat, and gzcat, are all the
> same file, but do different things based on argv[0].
Common in the past, but the GNU folks decided against that scheme
some time ago. (At least a dozen years?) For example:
proa$ pwd
/usr/local/gnu/gzip/gzip-1.12
proa$ ls -li gzip gunzip zcat
133419312 -r-xr-xr-x 1 sms wheel 2346 Jul 12 17:21 gunzip
133419311 -rwxr-xr-x 1 sms wheel 140108 Jul 12 17:21 gzip
133419314 -r-xr-xr-x 1 sms wheel 1984 Jul 12 17:21 zcat
"gunzip" and "zcat" are now shell scripts. Excerpt from gzip.c:
[...]
#ifndef GNU_STANDARD
# define GNU_STANDARD 1
#endif
#if !GNU_STANDARD
/* For compatibility with old compress, use program name as an option.
* Unless you compile with -DGNU_STANDARD=0, this program will behave as
* gzip even if it is invoked under the name gunzip or zcat.
*
* Systems which do not support links can still use -d or -dc.
* Ignore an .exe extension for MSDOS and OS/2.
*/
if (strncmp (program_name, "un", 2) == 0 /* ungzip, uncompress */
|| strncmp (program_name, "gun", 3) == 0) /* gunzip */
decompress = 1;
else if (strequ (program_name + 1, "cat") /* zcat, pcat, gcat */
|| strequ (program_name, "gzcat")) /* gzcat */
decompress = to_stdout = 1;
#endif
[...]
More information about the Info-vax
mailing list