System::CreateFile

System::CreateFile create or opens a file resource for reading or writing. This static method will check to see is the currently executing script has the appropriate permissions to the desired file before allowing the underline function to be called. This will block access to files even if the current process is executing as a user who has permissions under Windows native security protocols.

public System::CreateFile(
   WString FileName,
   Integer Flags = System::READ_ONLY | System::OPEN_ALWYS
:  OSHandle FileHandle
);

Parameters

FileName The name of the file to be opened or created.
Flags The Flags can be one of the following:- System::CREATE_ALWAYS, System::CREATE_NEW, System::OPEN_ALWAYS, System::OPEN_EXISTING, System::TRUNCATE_EXISTING and or'ed with System::READ_ONLY if no write access is required.
FileHandle The returned file handle if the static method does not return an error.

Return Values

The error.errorCode value will be set to the underlining windows error message code and the error.errorString will have a detailed description of the error.

Remarks

Example Use
variable fileHandle, fileBuffer;
System::CreateFile(L"MyFile.txt",System::OPEN_EXISTING|System::READ_ONLY:fileHandle);
System::ReadFile(fileHandle:fileBuffer);
System::MessageBox(fileBuffer.ToString(),L"File Contents of MyFile.txt");

Requirements

TScript Version: 1.0

Also See

System::ReadFile, System::SetFilePointer, System::WriteFile
 

Contact Ekky Software

All around the world Ekky Software is contactable seven days of the week by submitting the following details.

Thank you for your time and interest.
Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage Texas Business Software ObjectDatabase++ TScript Ekky Software Homepage Texas Business Software ObjectDatabase++ TScript