Another problem is, how can you map mime-type ids to mime-type strings? It's not possible to hard code an array of known mime-types and look it up with the ids. Mime-types can be added to and removed from the system dynamically using shared-mime-database. The only possible way to do it I can think of is to have a list of known types and use them only. Or do you have a better way to do it?
On Sun, Mar 18, 2012 at 11:31 PM, Stef Bon <[email protected]> wrote: > 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. > > Stef > > > > > 2012/3/17 PCMan <[email protected]>: > > 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. > > >
_______________________________________________ xdg mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/xdg
