Created
May 5, 2011 11:36
-
-
Save googya/956907 to your computer and use it in GitHub Desktop.
清除那些有效评论很少的专家
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_dir = Dir.open("expert ratings") | |
test_dir.entries[2..-1].each do |f| | |
begin | |
file = File.open("E:\\ratings_all\\expert ratings\\"+f.to_s) | |
rescue Errno::ENOENT=> error | |
next | |
end | |
fsize=file.size | |
file.close | |
File.delete(file) if fsize<9000 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment