|
|
1.1 root 1: #include "../h/param.h"
2: #include "../h/inode.h"
3: #include "../h/ino.h"
4: #include "../h/dir.h"
5: #include "saio.h"
6:
7: char line[100];
8:
9: main()
10: {
11: int i;
12:
13: printf("ls\n");
14: do {
15: printf(": "); gets(line);
16: i = open(line, 0);
17: } while (i < 0);
18:
19: ls(i);
20: }
21:
22: ls(io)
23: register io;
24: {
25: struct direct d;
26: register i;
27:
28: while (read(io, (char *)&d, sizeof d) == sizeof d) {
29: if (d.d_ino == 0)
30: continue;
31: printf("%d\t", d.d_ino);
32: for (i=0; i<DIRSIZ; i++) {
33: if (d.d_name[i] == 0)
34: break;
35: printf("%c", d.d_name[i]);
36: }
37: printf("\n");
38: }
39: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.