Jean Cyr
2006-Jan-23 19:25 UTC
[Samba] Odd Samba behavior using Windows XP client API RemoveDirectory function
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.
Gerald (Jerry) Carter
2006-Jan-26 16:55 UTC
[Samba] Odd Samba behavior using Windows XP client API RemoveDirectory function
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jean Cyr wrote:> 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.See the 'map readonly' smb.conf(5) parameter in 3.0.21. Or the better solution is to use 'store dos attributes' parameter with file system EAs. cheers, jerry ====================================================================I live in a Reply-to-All world ----------------------- Samba ------- http://www.samba.org Centeris ----------- http://www.centeris.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD17aWIR7qMdg1EfYRAqXDAJwJ2gHZN3aL5OJrJlvqLn7QzKRMgQCcCPEt x3SPMXVR4Lmi12V+LFVN9wI=ViX2 -----END PGP SIGNATURE-----