System::SetEndOfFile
System::SetEndOfFile will set the end of the file at the specified position.
System::SetEndOfFile( OSHandle FileHandle, Integer Position = 0, Integer Method = System::FILE_BEGIN : Integer Position );
Parameters
FileHandle | From previous call to System::CreateFile. |
Position | the position that the file wants to be moved to. |
Method | any one of:- System::FILE_BEGIN; System::FILE_CURRENT; xor System::FILE_END. |
Position | resulting position after the method has completed. |
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
- TScript
main(){ variable fileHandle, fileBuffer; System::CreateFile(u"MyFile.txt", System::OPEN_EXISTING|System::READ_ONLY:fileHandle); System::SetEndOfFile(fileHandle,50); System::ReadFile(fileHandle:fileBuffer); System::MessageBox(fileBuffer.ToString(), u"File Contents of MyFile.txt after 50 bytes"); }
Since
TScript Version 1.3
Also See
System::CreateFile, System::ReadFile, System::SetFilePointer, System::WriteFileListen All
Comments (0)