Skip to contentSkip to conversation

Usage of filetype

DISCUSSION Andi Kleen 1 participant 1 message Jan 19, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw
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.h in 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