File Operations Class

Entisoft Tools 2.0 Object Library
Version 2.1 Build 208
<-- Previous || Index || Main || Topics || Next -->

Declarations Section, AppendStringToFile Function, Checksum8File Function, Checksum16File Function, Checksum32File Function, ChecksumXFile Function, CompareFiles Function, CRC32File Function, CRC32FileSample Sub, DebugMessage Function, FileCharacterFrequency Function, FileExists Function, FileToString Function, FormatFileTable Function, KillIgnoreErrors Function, NameBackupTarget Function, NameMaybeBackupInTemp Function, NameAsBackup Function, ReplaceStringInFile Function, SizeFile Function, StringToFile Function

Declarations Section
Append String To File Function
Append a string to the named file. The file is created if it does not already exist. Function returns True upon success and False upon failure.
Checksum 8 File Function
"8-bit File Checksum" Return the 8-bit checksum of a file. The checksum is the sum of the ASCII values of all of the characters within the file. Checksum is returned as a one-character string. Uses modulo addition so that the function will return the 8 least significant bits of the sum.
Checksum 16 File Function
"16-bit File Checksum" Finds the 16-bit checksum of a file. The checksum is the sum of the ASCII values of all of the characters within the file. Checksum is returned as a Long (Integer) value between 0 and 65,536. Uses modulo addition so that the function will return the 16 least significant bits of the sum.
Checksum 32 File Function
"32-bit File Checksum" Finds the 32-bit checksum of a file. The checksum is the sum of the ASCII values of all of the characters within the file. Checksum is returned as a Double (precision floating-point) value that is a non-negative integer. Uses modulo addition so that the function will return the 32 least significant bits of the sum.
Checksum X File Function
"Exclusive Or ("XOR") File 'Checksum'" Generate a "checksum" by performing the Xor ("Exclusive Or") operation on each of the adjacent characters within a file. Checksum is returned as a one-character string. This is not really a "checksum" because that usually refers to sum of the ASCII values of the characters.
Compare Files Function
Compare two files to determine if they have the same contents. Return 0 if they are the same, Return 1 if they are different. Return -1 in case of most errors.
CRC32 File Function
"File 32-bit Cyclical Redundancy Check (CRC)" Finds the PKZIP compatible CRC of any size file. Return the 32-bit CRC value for the characters within a file. Unlike a checksum, the position of the characters within file affects the result. Matching CRC values are a much more reliable indicator of the accuracy of data than matching checksum values.
CRC32 File Sample Sub
Sample of the CRC32File Function.
Debug Message Function
Append a message to a "log" file, preceded by the current date and time. Function returns True upon success and False upon failure.
File Character Frequency Function
Count the frequency of each character within a file. Character counts are returned in a one-dimensional array of Variant values.
File Exists Function
Determine if the named file exists. Function returns True if the file exists. Function returns False if the file does not exist OR there was an error.
File To String Function
Read a file, returning its contents as a String. Function returns Null upon failure.
Format File Table Function
Aligns all of the columns within a delimited table that is read from a file.
Kill Ignore Errors Function
Delete a file, ignoring any errors that may occur, such as when the file does not exist.
Name Backup Target Function
Rename a file and keep a backup of the target file if the target file already exists. Backup file has same name as target file except that last character is changed to a hyphen ("-").
Name Maybe Backup In Temp Function
Rename a file, optionally making a backup of the target file in the Windows temporary directory.
Name As Backup Function
Rename a file by replacing the last character of the name with a hyphen ("-").
Replace String In File Function
Combination file copy operation with text replacement. All occurrences of some string are replaced by another string. Function returns True upon success and False upon failure.
Size File Function
Return the size in bytes (characters) of a file. Returns Null if the file name is Null. Returns -1 in case of errors.
String To File Function
Write a string to the named file. The file is created if it does not already exist. Function returns True upon success and False upon failure.

This Windows-based ActiveX DLL provides many useful routines through its function-bearing and data structure classes. Consult the Help file for more information, or call us at 1-310-472-3736. For the latest news and files, visit our home page on the World Wide Web: http://www.entisoft.com

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.