On Mon, 03 Sep 2007 18:42:52 +0000, Mildred wrote: > Le Mon 03/09/2007 à 17:45 Thomas Leonard à écrit: >> On Sun, 02 Sep 2007 12:20:12 +0200, Mildred wrote: >> >> In what way are they handled differently?` > > Normal directories, when you open them, you can view its contents in the > file manager. Bundles are like files in the sense that they have a mime > type different from inode/directory and when you open them, it's > generally with an appropriate application that will do specific things.
OK, so you want to give a MIME type (a subclass of inode/directory) to a directory. You can do that already like this: $ mkdir my-web-page $ setfattr -n user.mime_type -v bundle/html_files my-web-page $ getfattr -n user.mime_type my-web-page # file: my-web-page user.mime_type="bundle/html_files" However, I'm not sure any file manager currently supports that. It would be interesting to try and get support added to various file managers. >> Why are the MIME types not stored in the same way as for normal >> directories? i.e. as extended attributes (if specified at all), or >> guessed from the name or contents of the file otherwise. > > Because extended attributes are not relyable (it depends upon the > filesystem). No system is reliable if it's not supported. For example, in your proposed system if a user moves or renames a file using a non-bundle- aware program then the type information will get out-of-sync. Types will also be lost when copying out of a bundle. On the other hand, existing tools should preserve attributes: $ touch my-web-page/image $ setfattr -n user.mime_type -v image/png my-web-page/image $ mv my-web-page/image my-web-page/picture $ getfattr -n user.mime_type my-web-page/picture # file: my-web-page/picture user.mime_type="image/png" I'd prefer to see wider support for the existing mechanisms than trying to create a new system. That might mean persuading distributions to enable extended attributes by default. Another point from the spec: When a bundle must be copied or moved in a media that only accept files and not folders, the bundle MUST be transformed into a ZIP bundle. Why not do this for all directories, not just bundles? -- Dr Thomas Leonard http://rox.sourceforge.net GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1 _______________________________________________ xdg mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/xdg
