2014-12-25 49 views
1

有人可以看看我的算法,看看他們是否可以填充連續點的區域?我想提出一個Python程序,着眼於遠程目錄樹和本地目錄樹和同步兩人在一起,但在即時通訊的絆腳石:同步目錄樹算法幫助

(I have set folder checksums to be lists containing checksums of its children, 
only files have md5 checksum strings instead of lists) 

START 

Go through whole local tree and compare each node to all remote nodes 
according to these rules: 

    if the local file and a remote file have same md5 sum 
    and one of those files is closer to todays date, 
     if the one file is local, 
      then delete remote file and upload local file. 
     else 
      then delete local file and download remote file. 

    if the local folder and a remote folder have same checksum 
    and one of those folders is closer to todays date, 
     if the one folder is local, 
      then .... 
     else 
      then .... 

    else the local file/folder does not match any remote file/folder checksum, 
     then .... 

Go through whole remote tree and compare each node to all local nodes 
according to these rules: 

    if the remote file/folder does not match any local file/folder checksum, 
     then .... 

DONE 
+1

這似乎是你必須作出的決定。如果你不知道你想達到什麼,我認爲任何人都不能幫助你。 – fejese

+0

我不明白你已經填寫的部分。如果校驗和匹配,爲什麼你會刪除並重新下載其中一個文件? – Blckknght

+0

如果校驗和是相同的,我想保留最近修改過的那個。 – IndoNinja

回答

-1

我學會了如何GitHub的樹木提交工作。這是我嘗試製作的程序的另一種解決方案。

+0

這看起來不是一個合適的答案。請稍微擴展一下。 –