Re: [Fsp-users] Enable remote directory deletion on FSP-Server?
UDP File transfer protocol
Brought to you by:
hsn
From: Stefan B. <sb...@fr...> - 2009-08-26 12:03:32
|
Am Montag, den 24.08.2009, 16:47 +0200 schrieb Radim Kolar: > > Now I can create directories, up- and download files, rename files and > > directories and delete files. > > But it's not possible to delete such a created directory!!! > > > I know. This is known problem, i can take a closer look on it and fix it. I wonder why FSP was a successful file transfer utility in older days when directory deletion doesn't work... Or has the C function "rmdir()" changed? Today it removes a directory only if the directory is empty. > > As mentioned above, when I try to delete the empty directory "test", > > then I get "Can't remove test: rmdir: cannot unlink". I think fspd can't > > remove this directory because it isn't really empty because of the > > generated .FSP_OWNER file! > > > you are right. After asking Google I found these information: The error message comes from file ./server/file.c, line 623: <http://fsp.bzr.sourceforge.net/bzr/fsp/fsp/annotate/head% 3A/server/file.c> ----------------- const char *server_del_dir (PPATH * pp, DIRINFO *di) { [...] if(rmdir(pp->fullp) != 0) { chdir(pp->fullp); save_access_rights(di); chdir(home_dir); return("rmdir: cannot unlink"); } [...] } <http://www.opengroup.org/onlinepubs/000095399/functions/rmdir.html> says that "The directory shall be removed only if it is an empty directory.". IMHO fspd should first check if there exists any other files and directories than the FSP-dotfiles in this directory. Then fspd should delete the FSP-dotfiles with unlink() and after this cleanup calling the rmdir() function. Thanks for your effort. Greetings, Stefan Braun. |