System::ReadFile

System::ReadFile will read in the contents of a file previously opened by System::CreateFile.

public System::ReadFile(
   OSHandle FileHandle,
   Integer Length = TVariable::None,
   Integer Position = TVariable::None
:  BString FileContents
);

Parameters

FileHandleFrom previous call to System::CreateFile.
Lengthwill read the entire file to end if default parameter is passed.
Positionwill read from the current file position if default parameter is passed.
FileContentsa buffer containing the contents of the file successfully read.

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");

Since

TScript Version 1.0

Also See

System::CreateFile, System::SetFilePointer, System::WriteFile
Comments (0)Listen All
Characters left: 2500
 
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript