2002-01-19 18:26:11

by Hans-Joachim Baader

[permalink] [raw]
Subject: Usage of filetype

Hi,

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)?

Thanks,
hjb
--
Pro-Linux - Germany's largest volunteer Linux support site
http://www.pro-linux.de/ Public Key ID 0x3DDBDDEA


Attachments:
(No filename) (472.00 B)
(No filename) (200.00 B)
Download all attachments

2002-01-19 20:46:20

by Andi Kleen

[permalink] [raw]
Subject: Re: Usage of filetype

Hans-Joachim Baader <[email protected]> writes:

> 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