From: Theodore Ts'o Date: Tue, 26 Feb 2002 22:13:12 +0000 (-0500) Subject: In debugfs, make "ls -l" print out the file type information in the X-Git-Tag: E2FSPROGS-1.27-WIP-0305~5 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fa7c30276c2b3ff06ddfa6ac0067a753bfbe0d21;p=tools%2Fe2fsprogs.git In debugfs, make "ls -l" print out the file type information in the directory entry. --- diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index 2a0e482..f3a5a67 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,9 @@ +2002-02-26 Theodore Tso + + * ls.c (list_dir_proc): When listing the directory entry in long + format, include the file type of the directory entry in + parenthesis. + 2002-02-25 Theodore Tso * util.c (open_pager): If the PAGER environment is set to __none__ diff --git a/debugfs/ls.c b/debugfs/ls.c index 2fb91f5..96d2691 100644 --- a/debugfs/ls.c +++ b/debugfs/ls.c @@ -51,6 +51,7 @@ static int list_dir_proc(ext2_ino_t dir, char *buf, void *private) { + struct ext2_dir_entry_2 *d2; struct ext2_inode inode; ext2_ino_t ino; struct tm *tm_p; @@ -89,8 +90,9 @@ static int list_dir_proc(ext2_ino_t dir, strcpy(datestr, " "); memset(&inode, 0, sizeof(struct ext2_inode)); } - fprintf(ls->f, "%c%6u%c %6o %5d %5d ", lbr, ino, rbr, - inode.i_mode, inode.i_uid, inode.i_gid); + d2 = (struct dir_entry_2 *) dirent; + fprintf(ls->f, "%c%6u%c %6o (%d) %5d %5d ", lbr, ino, rbr, + inode.i_mode, d2->file_type, inode.i_uid, inode.i_gid); if (LINUX_S_ISDIR(inode.i_mode)) fprintf(ls->f, "%5d", inode.i_size); else