Write Files
Write text content to a file on a node
Signature
def write_files(node_id: str, file_path: str, content: str) -> WriteFilesResponseParameters
node_id(str) – target nodefile_path(str) – path on the node where content should be writtencontent(str) – text content to write
Path Handling
All files that were placed using the upload function will be defaulted to the /home/ubuntu/Desktop/MY_FILES directory.
If you specified a destination_path when using the upload function, it would have been adjusted to be prefixed by /home/ubuntu.
For more details on this, visit the Path Handling section of upload guide.
Returns
WriteFilesResponse object with:
status(str) – operation statusmessage(str) – response messagefile_path(str) – path where content was writtennode_id(str) – target node ID
Example
result = client.write_files(
node_id,
file_path="/home/ubuntu/notes.txt",
content="Hello from Heaptree!"
)
print(f"Write status: {result.status}")