After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 475296 - File-roller is threating a nfs mount like a remote filesystem
File-roller is threating a nfs mount like a remote filesystem
Product: file-roller
Classification: Applications
Component: general
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Depends on:
Reported: 2007-09-09 23:47 UTC by Robbert
Modified: 2007-09-10 10:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20

uri_is_local fixed (441 bytes, patch)
2007-09-09 23:48 UTC, Robbert
none Details | Review

Description Robbert 2007-09-09 23:47:21 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):

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.
Comment 1 Robbert 2007-09-09 23:48:07 UTC
Created attachment 95238 [details] [review]
uri_is_local fixed
Comment 2 Paolo Bacchilega 2007-09-10 07:10:26 UTC
Thanks Robbert, your patch works fine but I preferred to re-implement it using already available functions.  It now looks like this:

uri_is_local (const char *uri)
	return (! uri_has_scheme (filename)) || uri_scheme_is_file (filename);
Comment 3 Robbert 2007-09-10 10:00:09 UTC
That looks fine to me. But you made a typo, you should use the variable uri instead of filename.
Comment 4 Robbert 2007-09-10 10:01:32 UTC
I also can confirm that it's working.