# File lib/fog/storage/models/local/file.rb, line 39
        def destroy
          requires :directory, :key
          ::File.delete(path)
          dirs = path.split(::File::SEPARATOR)[0...-1]
          dirs.length.times do |index|
            dir_path = dirs[0..-index].join(::File::SEPARATOR)
            if dir_path.empty? # path starts with ::File::SEPARATOR
              next
            end
            # don't delete the containing directory or higher
            if dir_path == connection.path_to(directory.key)
              break
            end
            pwd = Dir.pwd
            Dir.chdir(dir_path)
            if Dir.glob('*').empty?
              Dir.rmdir(dir_path)
            end
            Dir.chdir(pwd)
          end
          true
        end