/* scan to end of line */
for(ptr
=line
; *ptr
; ptr
++)
/* check to see if a file was specified */
printf("usage: dev(unit,0)/directory\n");
/* do one correction first so the raw dev is not opened */
if((io
= open(line
, 0)) >= 0)
if((io
>= NFILES
+3) || (io
< 3))
_stop("open returned corrupt file index!");
if ((ip
->i_mode
& IFMT
) != IFDIR
) {
printf("%s is not a directory!\n", line
);
printf("%s is a zero length directory!\n", line
);
static char dirbuf
[DIRBLKSIZ
];
printf ("\nInode -> Name\n");
while ((size
= read(io
, dirbuf
, DIRBLKSIZ
)) == DIRBLKSIZ
) {
for(dp
= dirbuf
; (dp
< (dirbuf
+ size
)) &&
(dp
+ ((struct direct
*)dp
)->d_reclen
) < (dirbuf
+ size
);
dp
+= ((struct direct
*)dp
)->d_reclen
) {
if(((struct direct
*)dp
)->d_ino
== 0)
if(((struct direct
*)dp
)->d_reclen
>
DIRSIZ(((struct direct
*)dp
)))
if(((struct direct
*)dp
)->d_namlen
> MAXNAMLEN
+1)
_stop("Corrupt file name length! Run fsck soon!\n");
printf("%s -> %d\n", ((struct direct
*)dp
)->d_name
,
((struct direct
*)dp
)->d_ino
);