Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-14-2006, 05:29 AM   #1
LQ Newbie
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
can not delete NON-EMPTY directories through samba share

Hi all,

I have setup a Samba server as file and print server. Everything works perfectly, I can print, I can write, delete files through Samba. But, the only thing that does not work is to delete a NON-EMPTY directory. No error message received, just don't want to delete it. As soon as I delete all files from the directory, then the directory can be deleted too. The problem is recursive for subdirectories.

The shared folder is owned by root : products_admin
drwxrwsr-x 2 root products_admins 4096 Feb 13 07:56 data

This directory contains another directory created through his samba share
drwxrwsr-x 2 bas products_admins 4096 Feb 14 09:08 a_new_directory

As you can see, the directory is owned by user bas (that would be me) and by the group products_admin.
User bas is member of group products_admin.

The content of directory a_new_directory:
-rwxrwxr-x 1 bas products_admins 6769 Dec 12 10:14 softice.txt

I am trying to delete the directory with the same user bas, but this only succeeds when the directory is empty. Still I can rename it independently of it's content.

I know that in UNIX world, you can delete a folder which has some contents, only if you delete it's contents recursively. This should be specified in command line using option -R (-r). By default UNIX does not ask you if you want to delete the content of the directory. It's just give you an error message saying that what are you trying to delete is a directory (he thinks that you don't know that ) I think here is the same kind of problem.

Just think how awful is to delete a directory with lots of subdirectories. I don't think it's a permission problem (it can't be) and I could't find any posts on this problem over the internet.

Thanks for help,

Last edited by Sandor; 02-14-2006 at 06:23 AM.
Old 02-15-2006, 03:19 PM   #2
Registered: Nov 2005
Location: Detroit, Michigan -- USA
Distribution: Fedora Core
Posts: 90

Rep: Reputation: 15
I'm not sure how Unix commands differ from the Samba commands, but on Fedora I can run these commands to remove a non-empty directory:

rmdir --ignore-fail-on-non-empty directory_path
or this
rm -drf directory_path

Not sure if that'll work when logged into Samba, but it might be worth a shot.

Old 02-16-2006, 04:06 AM   #3
LQ Newbie
Registered: Feb 2006
Posts: 2

Original Poster
Rep: Reputation: 0

I think it is working now
I just need to use the correct tool
Windows Commander 5.11 does not work (maybe some config will correct the problem). A newer version (Total Commander) is working and also Windows Explorer
That's why I didn't find anybody with such problem.

Hope this helps others too



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete non-empty directories? Also have a terminal question Nylex Linux - General 10 07-16-2005 12:51 AM
how to search for and delete empty directories? BrianK Programming 4 06-03-2005 08:24 AM
samba share with write but not delete Red Squirrel Linux - Software 7 08-29-2004 07:12 PM
Removing non-empty directories brunnopessoa Linux - Newbie 8 11-13-2003 08:56 PM
how do I remove all empty directories? noisybastard Linux - General 2 08-11-2003 12:47 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration