GNOME Bugzilla – Bug 475296
File-roller is threating a nfs mount like a remote filesystem
Last modified: 2007-09-10 10:01:32 UTC
When opening files on a nfs mount the files are getting copied to my homedir (~/.fr-[randomhash]). This problem exists since the the ability to open files on gnome-vfs was introduced. It looks like that copying the archive to homedir is necessary for files on for example a ssh remote location since unrar, unzip etc doesn't support files on a ssh remote location. But file-roller is threating files on a nfs mount exactly the same way, what is rather unnecessary. Because it takes a lot of time before a big archive is opened. Extracting is really slow this way, since the file have to be copied to my home folder, get extracted and copied back. I found out that the problem is in the following piece of code (file-utils.c line 1253): gboolean uri_is_local (const char *uri) { GnomeVFSURI *vfs_uri; gboolean is_local; vfs_uri = new_uri_from_path (uri); g_return_val_if_fail (vfs_uri != NULL, FALSE); is_local = gnome_vfs_uri_is_local (vfs_uri); gnome_vfs_uri_unref (vfs_uri); return is_local; } gnome_vfs_uri_is_local says that a nfs url isn't local, what means that file-roller is threating it as a non local file. But file-roller should threat it as a local file, since nfs is mounted transparently. I made the following change: is_local = strcmp(gnome_vfs_uri_get_scheme (vfs_uri), "file") == 0; Instead of using gnome_vfs_uri_is_local I check whether the scheme is equal to file. If the schema is file, the file could be transparently accessed by the filesystem so we could threat it like a local file.
Created attachment 95238 [details] [review] uri_is_local fixed
Thanks Robbert, your patch works fine but I preferred to re-implement it using already available functions. It now looks like this: gboolean uri_is_local (const char *uri) { return (! uri_has_scheme (filename)) || uri_scheme_is_file (filename); }
That looks fine to me. But you made a typo, you should use the variable uri instead of filename.
I also can confirm that it's working.