Writebool Write(TLuaSFTPClientHandle FileHandle,const int iOffset,string vData) Return value Returns true if the operation was successful or false if otherwise. Parameters
Example --KNM Lua API example (C) 2010 Kaseya AB --Demonstrates the Lua SFTP client class sftp = TLuaSFTPClient() hFileHandle = TLuaSFTPClientHandle() --Open the file hFileHandle = TLuaSFTPClientHandle() if sftp:Open_ForWrite("test.txt",hFileHandle) == false then SetExitStatus("Open of file failed",false)
return
end
--Create a string and write it to the begining of the file sString = [[ test text ]]; if sftp:Write(hFileHandle,0,sString) == false then SetExitStatus("Write failed",false)
return
end
--Close the file sftp:Close(hFileHandle) | |||
Topic 9639: Send Feedback. Download a PDF of this online book from the first topic in the table of contents. Print this topic. |