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 573349 - Impossible to create a new folder in a ftp emplacement if there's already a folder named "new folder"
Impossible to create a new folder in a ftp emplacement if there's already a f...
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: ftp backend
1.1.x
Other Linux
: Normal normal
: ---
Assigned To: Andreas Henriksson
gvfs-maint
: 330926 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-02-27 05:02 UTC by Jean-Philippe Fleury
Modified: 2009-04-09 17:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Return proper GIO error codes when MKD fails. (1.68 KB, patch)
2009-03-07 21:18 UTC, Andreas Henriksson
needs-work Details | Review
Improved path, still needs work. (3.07 KB, patch)
2009-04-07 11:58 UTC, Andreas Henriksson
needs-work Details | Review

Description Jean-Philippe Fleury 2009-02-27 05:02:17 UTC
1) In Nautilus, open a ftp connection.

2) In this remote emplacement, create a new folder. Keep the default name "new folder".

3) In the same emplacement, create another new folder.

Actual result: the new folder isn't created, and this error message appears:

Erreur lors de la création du répertoire nouveau dossier.
Erreur lors de la création du répertoire dans ftp://user@ftp.host.ext/path.
Afficher plus de détails
L'opération a échoué

Expected result: we should be able to create a new folder even if there's already a folder named "new folder". A number should simply be added to the folder name, for example "new folder 2", as it's the case for local emplacement.
Comment 1 Nelson Benitez 2009-02-27 13:50:47 UTC
*** Bug 330926 has been marked as a duplicate of this bug. ***
Comment 2 Nelson Benitez 2009-02-27 13:55:18 UTC
I filed this bug back in 2006 but I'm marking it as dup because yours it's more descriptive and has a ftp account where the bug can be tested. 
Comment 3 Jean-Philippe Fleury 2009-02-27 23:26:42 UTC
(In reply to comment #2)
> yours it's more descriptive and has a ftp account where the bug can be tested.

The ftp account in the bug description his fictive, so just for example.
Comment 4 Cosimo Cecchi 2009-03-03 14:00:09 UTC
-> gvfs

I think this is due to some operation not implemented inside the FTP backend, as it works fine with local files. Reassigning to gvfs.
Comment 5 Nelson Benitez 2009-03-03 14:25:40 UTC
(In reply to comment #4)
> -> gvfs
> 
> I think this is due to some operation not implemented inside the FTP backend,
> as it works fine with local files. Reassigning to gvfs.
> 

But this same bug existed when nautilus had gnome-vfs, and it remains the same now with gio, so at first sight seems a nautilus issue, but I've not done further investigation.
Comment 6 Alexander Larsson 2009-03-05 12:08:33 UTC
I'm pretty sure the propblem is that the gvfs backend reports the wrong error when creating a new directory and one already exists.
Comment 7 Andreas Henriksson 2009-03-07 19:09:36 UTC
do_make_directory() in daemon/gvfsbackendftp.c probably needs to gain the ability to somehow tell if a 550 error response code was because of permission failure or already existing directory.
Comment 8 Benjamin Otte (Company) 2009-03-07 19:30:34 UTC
Out of interest, in what order should which errors be reported upon failures?

The gio docs only talk about NOT_FOUND and NOT_SUPPORTED, whcih the ftp backend is missing, too, but which are not the ones we want.
Comment 9 Andreas Henriksson 2009-03-07 21:18:03 UTC
Created attachment 130250 [details] [review]
Return proper GIO error codes when MKD fails.

we need to check if the 550 failure means "directory already exists", "file already exists", "permission denied" or what.... Previously we only returned a generic error for all cases, now we atleast detect if the directory already exists or else return the generic GIO error code..... 
This solves the immediate problem, but the new function error_550_exists in the patch should still have additional "check if regular file exists" code as well.
Comment 10 Benjamin Otte (Company) 2009-03-07 21:45:38 UTC
I'll mark the patch as needs-work so it doesn't show up as unreviewed or sth - and it's obviously not complete yet.
I'd like a patch that contains at least a proper EXISTS test and the NOT_FOUND test (should be just try_cd() to parent directory) so that g_file_make_directory_and_parents() works, too.
Comment 11 Andreas Henriksson 2009-04-07 11:58:18 UTC
Created attachment 132261 [details] [review]
Improved path, still needs work.

NOT_FOUND implemented (for "gvfs-mkdir -p"), file check on sites that support SIZE feature, still needs work...
Comment 12 Benjamin Otte (Company) 2009-04-09 17:01:36 UTC
A modified patch for this landed in svn trunk, and it should now work properly on most ftp servers.