From 379c2c17e68d5d471a6a9673b7e9cd1fb9d99bbb Mon Sep 17 00:00:00 2001 From: 53hornet <53hornet@gmail.com> Date: Sat, 2 Feb 2019 22:59:54 -0500 Subject: Init. --- pgm3/pgm3test.d/subdir/subfileinfo.c | 30 ++++++++++++++++++++++++++++++ pgm3/pgm3test.d/subdir/subsubdir/file1 | Bin 0 -> 1023 bytes pgm3/pgm3test.d/subdir/subsubdir/file2 | Bin 0 -> 1023 bytes pgm3/pgm3test.d/subdir/subsubdir/file3 | Bin 0 -> 1023 bytes 4 files changed, 30 insertions(+) create mode 100644 pgm3/pgm3test.d/subdir/subfileinfo.c create mode 100644 pgm3/pgm3test.d/subdir/subsubdir/file1 create mode 100644 pgm3/pgm3test.d/subdir/subsubdir/file2 create mode 100644 pgm3/pgm3test.d/subdir/subsubdir/file3 (limited to 'pgm3/pgm3test.d/subdir') diff --git a/pgm3/pgm3test.d/subdir/subfileinfo.c b/pgm3/pgm3test.d/subdir/subfileinfo.c new file mode 100644 index 0000000..eed7902 --- /dev/null +++ b/pgm3/pgm3test.d/subdir/subfileinfo.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include +#include + +main(argc,argv) +int argc; char *argv[]; +{ + + struct stat info; + + if (argc != 2) { + fprintf(stderr, "fileinfo: usage fileinfo filename\n"); + exit(1); + } + + if (stat(argv[1], &info) != 0) { + fprintf(stderr,"fileinfo: cannot stat %s:", argv[1]); + perror(NULL); + } + printf("%s: ", argv[1]); + printf("(device,i_number)=(%d/%d,%ld)", major(info.st_dev), minor(info.st_dev), (long) info.st_ino); + printf(" last accessed %d seconds ago\n", time(NULL)-info.st_atime); + if (S_ISREG(info.st_mode)) + printf("\tdesignated a regular file\n"); + if (S_ISLNK(info.st_mode)) + printf("\tdesignated a symlink\n"); +} diff --git a/pgm3/pgm3test.d/subdir/subsubdir/file1 b/pgm3/pgm3test.d/subdir/subsubdir/file1 new file mode 100644 index 0000000..1bce2be Binary files /dev/null and b/pgm3/pgm3test.d/subdir/subsubdir/file1 differ diff --git a/pgm3/pgm3test.d/subdir/subsubdir/file2 b/pgm3/pgm3test.d/subdir/subsubdir/file2 new file mode 100644 index 0000000..1bce2be Binary files /dev/null and b/pgm3/pgm3test.d/subdir/subsubdir/file2 differ diff --git a/pgm3/pgm3test.d/subdir/subsubdir/file3 b/pgm3/pgm3test.d/subdir/subsubdir/file3 new file mode 100644 index 0000000..1bce2be Binary files /dev/null and b/pgm3/pgm3test.d/subdir/subsubdir/file3 differ -- cgit v1.2.3