[Samba] Odd Samba behavior using Windows XP client API RemoveDirectory function

Jean Cyr 2way at dillobits.com
Mon Jan 23 19:24:36 GMT 2006


I'm having problems with a utility I wrote deleting folders from a
Thecus N4100 Samba based fileserver. I do not have access or control
over its Samba config file and this may not be a Samba problem but
perhaps someone here can point me in the right direction???
 
When I issue a Windows API RemoveDirectory function against an empty
folder residing on a Samba share, the function returns with a success
return code but does not delete the folder! This is a known problem
and is documented in the Cygwin rmdir command as occurring when the
folder is flagged as read-only, which is the Samba default.
 
When I issue a GetFileAttributes call the result does not show the
folder as being read-only, but looking at its properties under
explorer shows that it is!!!
 
There seems to be no way to programmatically delete such a folder, yet
when I delete it using the explorer it is removed without problem.
This led me to try the SHFileOperation function with the OF_DELETE
operator, thinking that if the shell could delete it then this might
work. Got even weirder results!!! The folder disappears from the
browser for 5 to 10 seconds then reappears!!!
 
There's got to be a way to delete such an empty folder since the
Windows Explorer can do it. Any tips or pointers would be much
appreciated.


More information about the samba mailing list