Skip to content

Instantly share code, notes, and snippets.

@wjessop
Created April 10, 2011 23:42
Show Gist options
  • Save wjessop/912859 to your computer and use it in GitHub Desktop.
Save wjessop/912859 to your computer and use it in GitHub Desktop.
# dir is an array of dir entries, eg: ['ar', 'fe', '4a', 'c9']
def delete_empty_dirs(dir)
begin
Dir.rmdir File.join(self.base_storage_path, dir.join('/'))
dir.pop
delete_empty_dirs(dir)
rescue SystemCallError
return
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment