DIO-Disk and File Input/Output Utility Class [Contribution]
Posted: Wed Aug 25, 2010 1:16 am
DIO is a utility class related to disk and file Input/Output using .Net. Each methods will return a 1 for success or 0 for failure wich make it easier under program control to take the proper action. The methods are:
⍝ BFileRead - Reads The Contents of a Binary File Into a Character Vector Without Encoding.
⍝ BFileWrite - Creates a New File, Write The Specified Character Vector to The File Without Encoding.
⍝ DialogFolder - Selects a Directory with FolderBrowserDialog.
⍝ DialogOpenFile - Selects a File to Open With OpenFileDialog.
⍝ DialogSaveFile - Selects a File to Save With SaveFileDialog.
⍝ DirCopy - Copies a Directory And Its Contents. SubDirectories Are Not Copied.
⍝ DirCreate - Creates All Directories And Subdirectories as Specified By Path.
⍝ DirDelete - Deletes The Specified Directory And Any Subdirectories in The Directory.
⍝ DirExists - Determines Whether The Given Path Refers to an Existing Directory on Disk.
⍝ DirMove - Moves a Directory And Its Contents. SubDirectories Are Moved.
⍝ DirRename - Renames a Directory (This Method is Identical to DirMove).
⍝ DirSize - Returns The Size in Bytes of a Directory And It's Subdirectories.
⍝ EncodingDetector - Returns The Encoding of a File And it's Content.
⍝ FileCopy - Copies an Existing File to a New File.
⍝ FileDelete - Deletes a File.
⍝ FileExists - Verifies if One or Many File(s) Exists.
⍝ FileMove - Moves a File to a New Location.
⍝ FileRename - Renames a File (This Method is Identical to FileMove).
⍝ FileSize - Returns The Size of a File in Bytes.
⍝ FileVersion - Returns The File Version of a File in Characters.
⍝ GetAttributes - Returns The Attributes of a File in Numeric And Litteral Form.
⍝ GetCreationTime - Returns The Creation Date And Time of a File as a DateTime Object.
⍝ GetDirCurrent - Returns The Current Directory Path.
⍝ GetDirectories - Returns The SubDirectories of a Directory.
⍝ GetDrives - Returns The Names of The Logical Drives on This Computer as "<drive letter>:\".
⍝ GetExtension - Returns The Extension of a Path String.
⍝ GetFiles - Returns The Names of Files in a Directory.
⍝ GetTempFileName - Returns a Uniquely Named Temporary File on Disk With Full Path.
⍝ GetTempPath - Returns The Path of The Current System's Temporary Folder.
⍝ SetAttributes - Sets The Attributes of a File.
⍝ SetDirCurrent - Sets The Current Directory Path.
⍝ TFileAppend - Appends The Specified Text to a File Using The Default Windows Code Page.
⍝ TFileRead - Reads The Contents of a Text File Using the Default Windows Code Page.
⍝ TFileWrite - Creates a New File, Writes The Text Using The Default Windows Code Page.
⍝ UFileAppend - Appends The Specified Text to a File Using The UTF-8 Encoding.
⍝ UFileRead - Reads The Contents of a Unicode Text File.
⍝ UFileWrite - Creates a New File, Writes The Text Using The UTF8 Encoding.
Pierre Gilbert
⍝ BFileRead - Reads The Contents of a Binary File Into a Character Vector Without Encoding.
⍝ BFileWrite - Creates a New File, Write The Specified Character Vector to The File Without Encoding.
⍝ DialogFolder - Selects a Directory with FolderBrowserDialog.
⍝ DialogOpenFile - Selects a File to Open With OpenFileDialog.
⍝ DialogSaveFile - Selects a File to Save With SaveFileDialog.
⍝ DirCopy - Copies a Directory And Its Contents. SubDirectories Are Not Copied.
⍝ DirCreate - Creates All Directories And Subdirectories as Specified By Path.
⍝ DirDelete - Deletes The Specified Directory And Any Subdirectories in The Directory.
⍝ DirExists - Determines Whether The Given Path Refers to an Existing Directory on Disk.
⍝ DirMove - Moves a Directory And Its Contents. SubDirectories Are Moved.
⍝ DirRename - Renames a Directory (This Method is Identical to DirMove).
⍝ DirSize - Returns The Size in Bytes of a Directory And It's Subdirectories.
⍝ EncodingDetector - Returns The Encoding of a File And it's Content.
⍝ FileCopy - Copies an Existing File to a New File.
⍝ FileDelete - Deletes a File.
⍝ FileExists - Verifies if One or Many File(s) Exists.
⍝ FileMove - Moves a File to a New Location.
⍝ FileRename - Renames a File (This Method is Identical to FileMove).
⍝ FileSize - Returns The Size of a File in Bytes.
⍝ FileVersion - Returns The File Version of a File in Characters.
⍝ GetAttributes - Returns The Attributes of a File in Numeric And Litteral Form.
⍝ GetCreationTime - Returns The Creation Date And Time of a File as a DateTime Object.
⍝ GetDirCurrent - Returns The Current Directory Path.
⍝ GetDirectories - Returns The SubDirectories of a Directory.
⍝ GetDrives - Returns The Names of The Logical Drives on This Computer as "<drive letter>:\".
⍝ GetExtension - Returns The Extension of a Path String.
⍝ GetFiles - Returns The Names of Files in a Directory.
⍝ GetTempFileName - Returns a Uniquely Named Temporary File on Disk With Full Path.
⍝ GetTempPath - Returns The Path of The Current System's Temporary Folder.
⍝ SetAttributes - Sets The Attributes of a File.
⍝ SetDirCurrent - Sets The Current Directory Path.
⍝ TFileAppend - Appends The Specified Text to a File Using The Default Windows Code Page.
⍝ TFileRead - Reads The Contents of a Text File Using the Default Windows Code Page.
⍝ TFileWrite - Creates a New File, Writes The Text Using The Default Windows Code Page.
⍝ UFileAppend - Appends The Specified Text to a File Using The UTF-8 Encoding.
⍝ UFileRead - Reads The Contents of a Unicode Text File.
⍝ UFileWrite - Creates a New File, Writes The Text Using The UTF8 Encoding.
Pierre Gilbert