Mime types for folders

Stef Bon stefbon at gmail.com
Tue Feb 8 03:55:01 PST 2011


I've had the same problem, assign some properties to a directory, and
then according to these properties, add for example a specific app in
the right click menu.

For example, with a directory representing an unformatted disk, offer
the partitionmanager as action.

Or in a smb share, make the apps handle differently the caching of files.

With KDE it looks as if a .directory file is the only place to give
information what the map is/represents.

And within this .directory file the miemtype is the only parameter for
this purpose.

Stef


2011/2/8 Keith Poole <platima at gmail.com>:
> Hi and thanks.
>
> I think being KDE only would be a problem. Are .directory files specifict to it? And is there any doco available for it?
>
> Could be a good starting point though.
>
> To clarify my goal; I want to associate folders with a special property (a .directory file, extension based mime type, etc), with a custom application (and icon handler).
>
> -K
>
>
>
> On 08/02/2011, at 7:40 PM, Stef Bon <stefbon at gmail.com> wrote:
>
>> Well, I'm building a construction which also requires/provides
>> information about a directory.
>>
>> for example:
>>
>> local.dev.cdrom.audio
>> local.dev.cdrom.blank
>> local.dev.cdrom.dvd
>> local.dev.disk.ata.partition
>>
>> and
>>
>> local.map.home
>>
>> remote.net.smb.workgroup
>> remote.net.smb.server
>> remote.net.smb.share
>>
>> I've called them subtypes. Well what's in a name, but I've used the
>> name type already in the software I'm working on.
>>
>> Well according to Chris the pattern can be set like:
>>
>>
>> MimeType="inode/directory;role=remote.net.smb.workgroup"
>>
>> for a directory which represents a smb workgroup
>>
>> The only location I think this can be set on a per directory basis is
>> a .directory file, in this dir
>>
>> or in the map:
>>
>> ~/.kde/share/apps/dolphin/view_properties/%localpath/.directory
>>
>>
>> but this is KDE. And not .local/.config.
>>
>> Stef
>>
>>
>>
>>
>> 2011/2/8 Keith Poole <platima at gmail.com>:
>>> Hi,
>>>
>>> The DVD folder was only an example, and I think there's many applications for this sort of functionality. The reason I'm asking about it is for a project I'm working on that requires something along those lines (FOSS Linux and Unix-like project).
>>>
>>> Do you think a magic pattern could be set to determine if it's a matching folder? Doesn't have to be an extension, could be a specific file inside the folder.
>>>
>>> Thanks
>>>
>>>
>>>
>>> On 08/02/2011, at 6:10 PM, Křištof Želechovski <giecrilj at stegny.2a.pl> wrote:
>>>
>>>> Dnia wtorek, 8 lutego 2011 o 01:28:38 Keith Poole napisał(a):
>>>>> Hi Kristof.
>>>>>
>>>>> A good example of what I'm trying to do would be to allow *.DVD folders to open in a specified application as opposed to opening in the file browser. Of course the user may still want to browse the folder etc, hence my subclassing.
>>>>>
>>>>> MIME types may not be the way to do this, but I was hoping for a solution that was transparent to the file manager as much as possible. The last thing I want to do is go patching thunar, konq, nautilus, etc.
>>>>>
>>>>
>>>> Why would you want to change the handler application?  A DVD holds tracks that hold read-only file systems that can hold any data, and with a special provision that some file systems within tracks allow you to "borrow" files stored on previous tracks.  So I guess that would be a set of numbered tracks that the application would extract content from, wouldn’t it?  I do not think such an application would be particularly useful, but it is of course up to you :-)
>>>>
>>>> However, have in mind that XDG tools are in a habit of looking *inside* files to determine what they contain; the file name is only a hint.  And yes, the file manager should automatically match the view mode to the perceived content if we want it to work just like Microsoft Windows Explorer (which is, admit it, quite smart in most cases, although probably not in the DVD case in particular — not that I can attest in either direction because I never saw such a directory in my life).
>>>>
>>>> IMHO,
>>>> Chris
>>> _______________________________________________
>>> xdg mailing list
>>> xdg at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/xdg
>>>
>


More information about the xdg mailing list