svoid dm_syncDirectoryToOtherMachine(File dir, S computerID, S remotePath) { print("Syncing dir " + dir + " to " + computerID + ":" + remotePath); new L dirs; for ping (File f : listFiles_noSymLinks(dir)) { S remote = addSlash(remotePath) + f.getName(); if (isDirectory(f)) dirs.add(f); else dm_sendFileToOtherMachineIfDifferent(f, computerID, remote); } for ping(File f : dirs) { S remote = addSlash(remotePath) + f.getName(); dm_syncDirectoryToOtherMachine(f, computerID, remote); } print("Synced dir " + dir + " to " + computerID + ":" + remotePath); }