static int dm_sendFileToOtherMachine_chunkSize = 100*1024; // 1024*1024; svoid dm_sendFileToOtherMachine(File f, S computerID, S remotePath) { dm_evalOnOtherMachine(computerID, "backupFile(" + quote(remotePath) + ");"); for (LongRange r : chunks(fileSize(f), dm_sendFileToOtherMachine_chunkSize)) { print("Sending file chunk " + r + " of " + f + " to " + computerID + ":" + remotePath); dm_evalOnOtherMachine(computerID, "saveBinaryFilePart_base64(" + quote(remotePath) + ", " + r.start + "L, " + quote(base64encode(loadBinaryFileChunk(f, r))) + ");"); } dm_evalOnOtherMachine(computerID, "truncateFile(" + quote(remotePath) + ", " + fileSize(f) + "L);"); }