/
gmSCOperatingSystemClass
gmSCOperatingSystemClass
Mark Juras
Owned by Mark Juras
The OperationgSystem Service Class
The service class OperatingSystem performs those operations that require direct access to the operating system that cannot implemented in a platform independent way. This implementation is provided for Windows platforms MSCPLAT. Other platforms would require their own version.The method OperatingSystem_CopyFile
Prototypeint OperatingSystem_CopyFile(char* SrcFile, char* DestFile);
Parameter | Description |
SrcFile | Contains the name of the source file in null-terminated string form. |
DestFile | Contains the name of the destination file in null-terminated form. |
If the copy succeeds, the return value is nonzero, else the return value is zero.
The method OperatingSystem_DeleteDirectory
Prototypeint OperatingSystem_DeleteDirectory(char* Directory);
Parameter | Description |
Directory | Contains the name of the directory to be deleted in null-terminated string form. |
If the directory is successfully deleted, then a zero is returned. If the directory cannot be deleted, then a one is returned.
The method OperatingSystem_GetGuid
Prototypeint OperatingSystem_GetGuid(char* guidStr,int length);
Parameter | Description |
guidStr | Receives the GUID as obtained from the operating system. It is not null-terminated. |
length | Specifies the length of guidStr. It is used to avoid overflow. No more than length characters will be copied into it. |
The method returns the length of the GUID string as returned.
The method OperatingSystem_GetFileInfo
Prototypeint OperatingSystem_GetFileInfo(char* Filename,tOperatingSystem_FileInfo* FileInfo);
Member | Description |
FileName | Full name of file |
Extension | Extension associated with file |
LocalStart | Start of local name |
TypeOfFile | The type of the file |
DateModified | Date last modified |
TimeModified | Time last modified |
DateCreated | Date created |
TimeCreated | Time created |
DateAccessed | Date last accessed |
TimeAccessed | Time last accessed |
CurrentSize | Current size of file |
Protection | Protection status |
Mode | Mode of file |
The parameters of the method are as follows:
Parameter | Description |
Filename | Contains the name of the file in null-terminated form. |
Fileinfo | Receives the information about the file as listed above. |
The method OperatingSystem_GetLibraryMethod
PrototypeMethodHandle OperatingSystem_GetLibraryMethod(void* library,CONST char* methodName);
Parameter | Description |
library | Specifies the handle of the library containing the desired method obtained from the method OperatingSystem_LoadLibrary. |
methodName | Contains the name of the method to be executed in null-terminated form. |
This method returns an execution handle to the method if all went well; else it returns a NULL.
The method OperatingSystem_GetTime
Prototypeint OperatingSystem_GetTime(void);
The method OperatingSystem_GetProgramName
Prototypevoid OperatingSystem_GetProgramName(char* name,int nName)
Parameter | Description |
name | Receives the name of the executing program in null-terminated form. |
nName | Specifies the size of the name return area and is used to avoid overflow. |
The method OperatingSystem_LoadLibrary
Prototypevoid* OperatingSystem_LoadLibrary(char* libName);
Parameter | Description |
libName | Contains the name of the library to be loaded in null-terminated string form. |
This method returns an opaque handle to the loaded library information if all went well; else it returns a NULL.
The method OperatingSystem_MakeDirectory
Prototypeint OperatingSystem_MakeDirectory(char* Directory);
Parameter | Description |
Directory | Contains the name of the directory to be created as a null-terminated string. |
If the directory is successfully created, then a zero is returned. If the directory cannot be created, then a one is returned.
The method OperatingSystem_ReadFileDirectory
Prototypeint OperatingSystem_ReadFileDirectory(char* DirName,tOperatingSystem_FileInfo* FileInfo);
Member | Description |
FileName | Full name of file |
Extension | Extension associated with file |
LocalStart | Start of local name |
TypeOfFile | The type of the file |
DateModified | Date last modified |
TimeModified | Time last modified |
DateCreated | Date created |
TimeCreated | Time created |
DateAccessed | Date last accessed |
TimeAccessed | Time last accessed |
CurrentSize | Current size of file |
Protection | Protection status |
Mode | Mode of file |
InternalInfo | Used internally |
The parameters of the method are as follows:
Parameter | Description |
DirName | Contains the name of the directory to be read on the initial call to this method. On subsequent calls this parameter is set to NULL. |
FileInfo | Receives the tOperatingSystem_FileInfo member values for the current file. |
If information about a first or next file is being returned, then a zero is returned. If no more files are present, a one is returned.
The method OperatingSystem_UnloadLibrary
Prototypevoid OperatingSystem_UnloadLibrary(void* library);
Parameter | Description |
library | Specifies the handle of the library to be unloaded as received from the method OperatingSystem_LoadLibrary. |
Table of Contents
, multiple selections available,
Related content
gmSCFileSystemClass
gmSCFileSystemClass
More like this
gmSCOfflineClass
gmSCOfflineClass
More like this
gmslSystemClass
gmslSystemClass
More like this
gmscWriteClass
gmscWriteClass
More like this
gmplRegistryStatement
gmplRegistryStatement
More like this
gmslWriteClass
gmslWriteClass
More like this