+ printf("%o", (int)buf->st_mode & 07777);
+ break;
+ case 't':
+ if (S_ISBLK(buf->st_mode)) {
+ printf("block");
+ } else if (S_ISCHR(buf->st_mode)) {
+ printf("character");
+ } else if (S_ISDIR(buf->st_mode)) {
+ printf("directory");
+ } else if (S_ISFIFO(buf->st_mode)) {
+ printf("fifo");
+ } else if (S_ISREG(buf->st_mode)) {
+ printf("regular");
+ } else if (S_ISLNK(buf->st_mode)) {
+ printf("symlink");
+ } else if (S_ISSOCK(buf->st_mode)) {
+ printf("socket");
+ } else {
+ printf("unknown");
+ }