prevent rmdir of non-empty directories

git-svn-id: https://kippo.googlecode.com/svn/trunk@38 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster 2009-11-20 17:01:10 +00:00
parent 078904c7a8
commit 536ec915d1
1 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,10 @@ class command_rmdir(HoneyPotCommand):
def call(self):
for f in self.args:
path = self.fs.resolve_path(f, self.honeypot.cwd)
if len(self.fs.get_path(path)):
self.writeln(
'rmdir: failed to remove `%s\': Directory not empty' % f)
continue
try:
dir = self.fs.get_path('/'.join(path.split('/')[:-1]))
except IndexError: