Suggestion to keep the type of a file or directory in the stat field st_rdev.

Stef Bon stefbon at
Sun Mar 18 08:31:01 PDT 2012

Using Xattr is also possible.

But keep in mind that storing this kind of information in extended attributes
will result in two extra calls per file or directory, while when
storing this in the rdev field no extra calls are required. And why
use xattr when the rdev field is available?

Still the storing of the type of the file or directory is the storing
of an numerical value.


2012/3/17 PCMan < at>:
> Can't xattr be used for this purpose?
> IIRC storing mime-types in xattr is proposed long time ago.
> However, most applications do not seem to use this.
> Though it might be less efficient than a numeric id, this might be a more
> portable way than using the rdev hack.

More information about the xdg mailing list