同步目录树算法帮助

时间:2014-12-25 02:12:03

标签: python algorithm directory-structure

有人可以看看我的算法,看看他们是否可以填充连续点的区域???我正在制作一个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 个答案:

答案 0 :(得分:-1)

我了解了GitHub如何提交树。这是我试图制作的程序的替代解决方案。