gmslAPI
0.1
gmslAPI: An API for Developing Upgrade Solutions using Great Migrations Technology
|
The class FileSystem interacts with the operating system to form, decompose, and determine file names and attributes so that they conform the requirements of the hosting platform. In addition, it performs several low level file management operations such as searching for files, loading text files into internal text streams, and generating GUIDs. A full file name is viewed as consisting of three components. The pathname contains the location within the file system of the file. If it is omitted the the currently selected location is assumed. The localname contains the actual name of the file. This is the only component that cannot be ommitted. The extension contains a short extension that describes the type of the file. If it is omitted then the context is often used to determine its value. Note that in the scripting language itself the class is called "System". More...
Static Public Member Functions | |
static string | Directory (string filename, int Remove) |
The Directory method gets the full directory name from a pathname by removing the local filename and a specified number of subdirectories. More... | |
static string | Directory (string filename) |
static bool | FileExists (string FileName) |
The FileExists method attempts to open a file with read only shared access to determine if it could be accessed by the current process. More... | |
static string | FileName (string pathname) |
The FileName method extracts the local name from a full filename, the extension is included with the name. More... | |
static void | FindFiles (Text fileNames, string directory, string extensions) |
The FindFiles method searches the directory tree starting in a specified directory for all files that have some specified number of extensions. The full names of the local files are stored in a text stream. More... | |
static string | Guid (string GuidName) |
The Guid method checks the runtime registries for a Guid terminal registry type whose source matches a specified name. The user storage area is checked first, then the language area. More... | |
static int | LoadFile (string filename, bool strip) |
The LoadFile method loads the content of a text file into a text stream in storage. Optionally, trailing whitespace is stripped. The file is closed after it has been read. Note that both ASCII and Unicode files can be read by this method. The Unicode is transparently converted to ASCII before loading the records into the text stream. More... | |
static int | LoadFile (string filename) |
static string | LocalFileName (string pathname) |
The LocalFileName method extracts the local name from a full filename. Any extension is not included. More... | |
static void | LogMessage (string message) |
The LogMessage method appends the specified message to the back of the current logging file. The file is opened, the message is appended, and then the file is closed. Short of major system failures the user can be assured that the last message sent by the application will in fact be in the file – i.e. any internal buffers for the file are flushed on every write. More... | |
static void | LogSetName (string fileName, int status) |
The LogSetName method sets the name of the file to receive all subsequent log messages. More... | |
static string | MakePathName (string path, string name, string extn) |
The MakePathName method forms a full filename from its components. This method views a file as though it consisted of three concatenated components: path name, local name, and extension. This method constucts the the full name in accordance with the conventions of the platform. More... | |
static string | MakeRelativeName (string parentFile, string childFile) |
The MakeRelativeName method creates a relative pathname of a child file as referenced by a parent file, such as a code file being referenced by a project file. More... | |
static int | ParseFileName (string FileName, ref int LocalStart, ref int XtnStart) |
The ParseFileName method parses a filename into its components. It views a filename as though it consisted of three concatenated components: path name, local name, and extension. This method computes the relative position within the full name of the start of the local name and the start of the extension. Since the path name is always first, if the local name start is greater than zero, then the beginning of the filename contains a path name. More... | |
The class FileSystem interacts with the operating system to form, decompose, and determine file names and attributes so that they conform the requirements of the hosting platform. In addition, it performs several low level file management operations such as searching for files, loading text files into internal text streams, and generating GUIDs. A full file name is viewed as consisting of three components. The pathname contains the location within the file system of the file. If it is omitted the the currently selected location is assumed. The localname contains the actual name of the file. This is the only component that cannot be ommitted. The extension contains a short extension that describes the type of the file. If it is omitted then the context is often used to determine its value. Note that in the scripting language itself the class is called "System".
|
static |
The Directory method gets the full directory name from a pathname by removing the local filename and a specified number of subdirectories.
filename | contains the full pathname of a file whose directory location is wanted. |
Remove | specifies the number of subdirectory names to be removed from the back of the directory name. |
|
static |
The FileExists method attempts to open a file with read only shared access to determine if it could be accessed by the current process.
FileName | contains the file name to be checked. |
|
static |
The FileName method extracts the local name from a full filename, the extension is included with the name.
pathname | contains the file name to be parsed. |
|
static |
The FindFiles method searches the directory tree starting in a specified directory for all files that have some specified number of extensions. The full names of the local files are stored in a text stream.
fileNames | The fileNames parameter is the text stream that will receive the file names. |
directory | The directory parameter contains the full name of the root directory for the search. |
extensions | The extensions parameter contains a comma-delimited list of the extensions to be searched for. |
|
static |
The Guid method checks the runtime registries for a Guid terminal registry type whose source matches a specified name. The user storage area is checked first, then the language area.
GuidName | contains the source name for the guid. It may be null or empty. |
|
static |
The LoadFile method loads the content of a text file into a text stream in storage. Optionally, trailing whitespace is stripped. The file is closed after it has been read. Note that both ASCII and Unicode files can be read by this method. The Unicode is transparently converted to ASCII before loading the records into the text stream.
filename | contains the full filename for the text file whose content is to be loaded. |
strip | If true, trailing whitespace is stripped. This is the default. |
|
static |
The LocalFileName method extracts the local name from a full filename. Any extension is not included.
pathname | contains the file name to be parsed. |
|
static |
The LogMessage method appends the specified message to the back of the current logging file. The file is opened, the message is appended, and then the file is closed. Short of major system failures the user can be assured that the last message sent by the application will in fact be in the file – i.e. any internal buffers for the file are flushed on every write.
message | contains the message to be logged. The maximum length of a message is 32000 characters. Longer messages will be truncated. |
|
static |
The LogSetName method sets the name of the file to receive all subsequent log messages.
fileName | contains the name of file to receive messages. |
status | specifies the status code of the message issuing logic: 0 - Issue no message; -1 - Before issuing the next message truncate the file receiving messages; 1 - Write each message to the back of the current logging file. |
|
static |
The MakePathName method forms a full filename from its components. This method views a file as though it consisted of three concatenated components: path name, local name, and extension. This method constucts the the full name in accordance with the conventions of the platform.
path | contains the path name to be used. It may be null or empty, in which case a local filename is constructed. |
name | contains the local name of the file. |
extn | contains the extension to be used. If it is null or empty, then the filename contains no extension. |
|
static |
The MakeRelativeName method creates a relative pathname of a child file as referenced by a parent file, such as a code file being referenced by a project file.
parentFile | contains the full pathname of the parent file. |
childFile | contains the full pathname of the child file. |
|
static |
The ParseFileName method parses a filename into its components. It views a filename as though it consisted of three concatenated components: path name, local name, and extension. This method computes the relative position within the full name of the start of the local name and the start of the extension. Since the path name is always first, if the local name start is greater than zero, then the beginning of the filename contains a path name.
FileName | contains the filename to be parsed. |
LocalStart | returns the offset of the start of the local name in the filename. A value of zero indicates that the name contains no path name component. |
XtnStart | returns the offset of the start of the extension in the filename. A value equal to the length of the filename indicates that the name had no extension. |