Re: Ask KE System (转载)# Stock
c*n
1 楼
给一个file path,把里面所有相同的文件都放到一起,把路径用List
- >
输出出来。
相同的定义式byte对比。
相同文件的文件名不一定一样,里面可能还会有sub folder
# Question:
#
# Find files that have the exact same contents in a given directory. Write a
function that takes a path and returns a list of lists or sets. Each set
should contain files that have the same content.
#
# An example output is for the input "/foo/" is:
# [
# ["/foo/bar.png", "/foo/images/foo.png"],
# ["/foo/file.tmp", "/foo/other.temp", "/foo/temp/baz/that.foo"]
# ]
#
求大牛前辈们指点!非常感谢!