Readbool Read(TLuaSFTPClientHandle FileHandle,int iOffset,int iLen,string &sData) Return value Returns true if the operation was successful or false if otherwise. Parameters
Remarks Only text files can be read with this function. Example --KNM Lua API example (C) 2010 Kaseya AB --Demonstrates the Lua SFTP client class sftp = TLuaSFTPClient() hFileHandle = TLuaSFTPClientHandle() --Open the file bOk = sftp:Open_ForRead("test.txt",hFileHandle) if bOk == false then SetExitStatus("Open failed",false) return
end
sTemp = "" --Read the first 20 bytes bOk,sTemp = sftp:Read(hFileHandle,0,20,sTemp) if bOk == false then SetExitStatus("Read failed",false) return
end
print(sTemp) | |||
Topic 9635: Send Feedback. Download a PDF of this online book from the first topic in the table of contents. Print this topic. |