Created fileUtil

This commit is contained in:
2015-03-30 10:29:16 -04:00
parent 6e46dce79e
commit f34a9a010d
3 changed files with 34 additions and 15 deletions

25
source/filesUtil.rb Normal file
View File

@@ -0,0 +1,25 @@
require 'FileUtils'
class Filesutil
def findFilesByFileName(path,filename)
files = Dir["#{path}/**/#{filename}"]
return files
end
def getExpandedPathByFileName(file)
return File.expand_path(file.to_s)
end
def removeFile(file)
FileUtils.rm(getExpandedPathByFileName(file))
end
def getDirectoryNameByFile(file)
return File.dirname("#{file}")
end
def getAllFilesByPath(path)
return Dir["#{path}/*.*"]
end
end