diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /unix/shlib/inode.c | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/shlib/inode.c')
-rw-r--r-- | unix/shlib/inode.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/unix/shlib/inode.c b/unix/shlib/inode.c new file mode 100644 index 00000000..98d2dd86 --- /dev/null +++ b/unix/shlib/inode.c @@ -0,0 +1,28 @@ +/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + */ + +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> + +/* + * INODE -- Print the inode number and other information for a file or files. + */ +main (argc, argv) +int argc; +char *argv[]; +{ + struct stat fi; + int argno; + char *file; + + printf ("IDEVICE INO MODE NLK UID DEV SIZE FILE\n"); + for (argno=1; argno < argc; argno++) + if (stat (file=argv[argno], &fi) == -1) + fprintf (stderr, "cannot stat %s\n", file); + else { + printf ("%7d%7d%7o%4d%5d%8d%8d %s\n", + fi.st_dev, fi.st_ino, fi.st_mode, fi.st_nlink, + fi.st_uid, fi.st_rdev, fi.st_size, file); + } +} |