import os
import tempfile
import isystem.connect as ic
winidea_id = ''
def test_readWrite():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
rfCtrl = ic.CRemoteFileController(connMgr)
with tempfile.TemporaryDirectory() as tmpDirPath:
filePath = os.path.join(tmpDirPath, "localFile.txt")
rfCtrl = ic.CRemoteFileController(connMgr)
rfCtrl.readFromRemote("src/main.cpp", filePath)
print(f"Remote file read into: {filePath}")
print(f"Writing local file back to remote 'src/main.cpp'...")
rfCtrl.writeToRemote(filePath, "src/main_write_back.cpp")
if __name__ == "__main__":
test_readWrite()