Deleted Added
sdiff udiff text old ( 21308 ) new ( 26497 )
full compact
1/* fileman.c -- A tiny application which demonstrates how to use the
2 GNU Readline library. This application interactively allows users
3 to manipulate files and their modes. */
4
5#include <stdio.h>
6#include <sys/types.h>
7#include <sys/file.h>
8#include <sys/stat.h>
9#include <sys/errno.h>
10
11#include <readline/readline.h>
12#include <readline/history.h>
13
14extern char *getwd ();
15extern char *xmalloc ();
16
17/* The names of functions that actually do the manipulation. */
18int com_list (), com_view (), com_rename (), com_stat (), com_pwd ();
19int com_delete (), com_help (), com_cd (), com_quit ();
20
21/* A structure which contains information on the commands this program

--- 27 unchanged lines hidden (view full) ---

49/* The name of this program, as taken from argv[0]. */
50char *progname;
51
52/* When non-zero, this global means the user is done using this program. */
53int done;
54
55char *
56dupstr (s)
57 int s;
58{
59 char *r;
60
61 r = xmalloc (strlen (s) + 1);
62 strcpy (r, s);
63 return (r);
64}
65

--- 233 unchanged lines hidden (view full) ---

299 if (stat (arg, &finfo) == -1)
300 {
301 perror (arg);
302 return (1);
303 }
304
305 printf ("Statistics for `%s':\n", arg);
306
307 printf ("%s has %d link%s, and is %d byte%s in length.\n", arg,
308 finfo.st_nlink,
309 (finfo.st_nlink == 1) ? "" : "s",
310 finfo.st_size,
311 (finfo.st_size == 1) ? "" : "s");
312 printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime));
313 printf (" Last access at: %s", ctime (&finfo.st_atime));
314 printf (" Last modified at: %s", ctime (&finfo.st_mtime));
315 return (0);

--- 111 unchanged lines hidden ---