Usage of filetype
Quoted 5 lines · Hans-Joachim Baader
in the tune2fs manual I found the ext2 option 'filetype'. A file type seems to be an 8 bit number, defined in
linux/dirent.hin struct dirent64. However, I didn't find any further docs about it, and I don't know any userspace tools to read/set it. Could anyone please point me to more info (or explain if this feature has any use)?
It sets the d_type field in struct dirent on readdir. See /usr/include/dirent.h in glibc for a list of the types. It's useful to find out something about a file without reading its inode (=causing a slow seek of the hard disk). For example it can be used to optimize find(1) or ls(1).
-Andi