Changed filepath script to output to csv instead of txt

This commit is contained in:
2015-08-04 10:10:58 -04:00
parent f18fc308f9
commit 192ce76dc5
6 changed files with 46 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ require_relative 'filesUtil'
require_relative 'filecreate'
@outputFile = Filecreate.new
@outputFile.filename = "files.txt"
@outputFile.filename = "files.csv"
@outputFile.create
@filesUtil = Filesutil.new
@fileSystem = Windowsfilesystem.new
@@ -15,8 +15,12 @@ require_relative 'filecreate'
@files = @filesUtil.findFilesByFileName(drive.Path,'*.*')
@filesTooLong = @files.select{|f| @filesUtil.getExpandedPathByFileName(f).length > 255}
@filesTooLong.each do |file|
@whatToWrite = @filesUtil.getExpandedPathByFileName(file)
@outputFile.writeWindowsFilePath(@whatToWrite)
@pathLength = @filesUtil.getExpandedPathByFileName(file).length.to_s
@path = @filesUtil.getExpandedPathByFileName(file).to_s
@path = @path.gsub("/","\\")
@fileName = @filesUtil.getFileBasename(file).to_s
@whatToWrite = [@pathLength,@path,@fileName]
@outputFile.writeToCsv(@whatToWrite)
end
end
end