Sha256: 2e38e9fd045f9329330dfa9a831bda14fe2d3b782f1e45af708a95eb2f2bdace

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

module Wiris
	class FileSystem
		def self.readDirectory(folder)
			return Dir::entries(folder) - ['.'] - ['..']
		end

		def self.createDirectory(folder)
			Dir.mkdir(folder)
		end

		def self.exists(folder)
			File.exists?(folder)
		end

		def self.fullPath(path)
			if !exists(path)
				return nil
			end
			return File::realpath(path)
		end
		def self.rename (path, newpath)
			File::rename(path, newpath)
			raise Exception, "Unable to rename \""+path+"\" to \""+newpath+"\"."
		end
		def self.isDirectory(path)
			return File.directory?(path)
		end
		def self.deleteDirectory(folder)
			if (Dir.entries(folder) == ['.', '..'])
				return Dir.delete(folder)
			end
		end
		def self.deleteFile(file)
			return File.delete(file)
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wirispluginengine-3.62.0.1322 lib/src-generic/FileSystem.rb