Utils.File
class Utils.File
Method Inventory
- CopyFile()
- DeleteDirIfEmpty()
- DeleteFile()
- DeleteFilesInDirectory()
- EndBatchFile()
- EndErrorsFile()
- GenerateFileFromHTML()
- GenerateListOfFilesFromHTML()
- GetFirstLine()
- GetSubdirectoryPaths()
- MakeWindowsFile()
- SetUpFile()
- StartBatchFile()
- StartErrorsFile()
- WriteFileGenerator()
- WriteFileIntoFile()
Methods
classmethod DeleteDirIfEmpty(targetdir)
Deletes the given filename if possible; logs an error if not (DBMTables.ActivityLog).
Delete all files within the given directory. Does not affect items of other types that may be in the directory (e.g. subdirectories)
classmethod EndBatchFile(file As %Library.File)
classmethod EndErrorsFile(writer As %XML.Writer, reportfilename="", verbose As %Boolean = 0)
Given the name of a file, return the first line in the file
classmethod GetSubdirectoryPaths(directory As %String) as %DynamicArray
Given a directory, return a dynamic array containing the paths to all subdirectories within that directory.
Given the name of a file that has Unix line endings, create a new file that has Windows line endings
classmethod SetUpFile(filename As %String, verbose As %Boolean = 0, unicode As %Boolean = 0) as %Library.File
given a filename, create a file object, try to open the file, and return a handle to the file object
classmethod StartBatchFile(file As %Library.File, caller As %String = "", callingClass As %String = "", verbose As %Boolean = 0, forTechServices As %Boolean = 0)
classmethod StartErrorsFile(reportfilename="", verbose As %Boolean = 0) as %XML.Writer
Starts an errors XML file and returns an OREF to the %XML.Writer that is generating it
classmethod WriteFileGenerator(inputFilename As %String = "C:\TEMP\test.txt")
This method reads the contents of the file whose name is given by fileToRead
and writes that content, line by line, into fileInstance, which is
an instance of %File, presumed to be open.