Re: Prevent MIME guessing in FUSE mount



Hi Colin,

this is a question for gtk-devel-list gnome org (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 <gvfs-list gnome org> 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
_______________________________________________
gvfs-list mailing list
gvfs-list gnome org
https://mail.gnome.org/mailman/listinfo/gvfs-list


--
Ondrej Holy
Software Engineer, Core Desktop Development
Red Hat Czech s.r.o


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]