Created
April 10, 2011 23:42
-
-
Save wjessop/912859 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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