Hi Colin,

this is a question for [email protected] (see
https://developer.gnome.org/glib/stable/glib-resources.html#id-1.2.9.5).

But as far as I can tell, there isn't probably any configuration option,
but adding "user.mime_type" support for glib sounds like a good idea...

Regards

Ondrej

st 8. 8. 2018 v 16:07 odesílatel Colin Atkinson via gvfs-list <
[email protected]> napsal:

> Hi all,
> First of all, I apologize in advance if this isn't the right place for
> this. If it is not, a pointer in the right direction would be greatly
> appreciated.
>
> I'm working on a FUSE file system which makes network requests on
> write/read. This is all well and good, until the mounted directory is
> opened in a GTK application (nautilus, or any file selection dialog). If
> there are any files without an extension, 4096 bytes are read from this
> file in order to guess the MIME type. This can add significant overhead, as
> well as causing mystery network requests, which I'd like to avoid.
>
> Is there any way to prevent this behavior at a per-file or per-directory
> level? According to the FreeDesktop standards[0], this could be done using
> the "user.mime_type" xattr, but this doesn't actually appear to be used by
> glib.
>
> From what I can tell, the algorithm [1] used simply checks the filename
> against known globs, checks if the file is empty, and then if not, reads
> these bytes.
>
> Is there a higher-level configuration option I'm missing? Or would
> changing this behavior require submitting a patch to glib?
>
> Cheers,
> Colin
>
> [0]:
> https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html#idm140625828614912
> [1]: https://github.com/GNOME/glib/blob/master/gio/xdgmime/xdgmime.c#L489
>
> _______________________________________________
> gvfs-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/gvfs-list
>


-- 
Ondrej Holy
Software Engineer, Core Desktop Development
Red Hat Czech s.r.o
_______________________________________________
gvfs-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gvfs-list

Reply via email to