diff --git dirops.c dirops.c
index dcaddab..4c49aa6 100644
--- dirops.c
+++ dirops.c
@@ -110,12 +110,33 @@ static int sf_dir_release(struct inode *inode, struct file *file)
     return 0;
 }
 
+static int get_d_type(RTFMODE fMode)
+{
+    // 1513: linux/include/linux/fs.h
+    // DT_UNKNOWN: 0, DT_FIFO: 1, DT_CHR: 2, DT_DIR: 4, DT_BLK: 6, DT_REG: 8, DT_LNK: 10, DT_SOCK: 12, DT_WHT: 14
+
+    int d_type;
+    switch (fMode & RTFS_TYPE_MASK)
+    {
+        case RTFS_TYPE_FIFO:        d_type = 1; break;
+        case RTFS_TYPE_DEV_CHAR:    d_type = 2; break;
+        case RTFS_TYPE_DIRECTORY:   d_type = 4; break;
+        case RTFS_TYPE_DEV_BLOCK:   d_type = 6; break;
+        case RTFS_TYPE_FILE:        d_type = 8; break;
+        case RTFS_TYPE_SYMLINK:     d_type = 10; break;
+        case RTFS_TYPE_SOCKET:      d_type = 12; break;
+        case RTFS_TYPE_WHITEOUT:    d_type = 14; break;
+        default:                    d_type = 0; break;
+    }
+    return d_type;
+}
+
 /**
  * Extract element ([dir]->f_pos) from the directory [dir] into [d_name].
  *
  * @returns 0 for success, 1 for end reached, Linux error code otherwise.
  */
-static int sf_getdent(struct file *dir, char d_name[NAME_MAX])
+static int sf_getdent(struct file *dir, char d_name[NAME_MAX], int *d_type)
 {
     loff_t cur;
     struct sf_glob_info *sf_g;
@@ -203,6 +224,8 @@ static int sf_getdent(struct file *dir, char d_name[NAME_MAX])
             info = (SHFLDIRINFO *) ((uintptr_t) info + size);
         }
 
+        *d_type = get_d_type(info->Info.Attr.fMode);
+
         return sf_nlscpy(sf_g, d_name, NAME_MAX,
                          info->name.String.utf8, info->name.u16Length);
     }
@@ -246,8 +269,9 @@ static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir)
         ino_t fake_ino;
         loff_t sanity;
         char d_name[NAME_MAX];
+        int d_type;
 
-        err = sf_getdent(dir, d_name);
+        err = sf_getdent(dir, d_name, &d_type);
         switch (err)
         {
             case 1:
@@ -282,13 +306,13 @@ static int sf_dir_read(struct file *dir, void *opaque, filldir_t filldir)
         }
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
-        if (!dir_emit(ctx, d_name, strlen(d_name), fake_ino, DT_UNKNOWN))
+        if (!dir_emit(ctx, d_name, strlen(d_name), fake_ino, d_type))
         {
             LogFunc(("dir_emit failed\n"));
             return 0;
         }
 #else
-        err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, DT_UNKNOWN);
+        err = filldir(opaque, d_name, strlen(d_name), dir->f_pos, fake_ino, d_type);
         if (err)
         {
             LogFunc(("filldir returned error %d\n", err));
