SCCS-vsn: usr.bin/file/file.c 4.4
-static char sccsid[] = "@(#)file.c 4.3 (Berkeley) 4.3";
+static char sccsid[] = "@(#)file.c 4.4 (Berkeley) 4.4";
/*
* file - determine type of file
*/
/*
* file - determine type of file
*/
struct stat mbuf;
ifile = -1;
struct stat mbuf;
ifile = -1;
- if(stat(file, &mbuf) < 0) {
+ if (lstat(file, &mbuf) < 0) {
printf("cannot stat\n");
return;
}
printf("cannot stat\n");
return;
}
printf("character");
goto spcl;
printf("character");
goto spcl;
- case S_IFDIR:
- printf("directory\n");
- return;
-
- case S_IFMPC:
- printf("char multiplexor\n");
+ case S_IFLNK:
+ printf("symbolic link\n");
- case S_IFMPB:
- printf("block multiplexor\n");
+ case S_IFDIR:
+ printf("directory\n");