Created
May 9, 2019 14:06
-
-
Save mvidner/551d56d676e5700db6926c480276ee37 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
#!/usr/bin/ruby | |
# https://bugzilla.suse.com/show_bug.cgi?id=1132650 | |
# https://github.com/yast/yast-packager/pull/434 | |
def file_properties(filename) | |
print "." | |
File.lstat(filename) | |
end | |
def interesting?(stat) | |
print "?" | |
stat.symlink? | |
end | |
filenames = Dir.glob("/usr/lib/*") | |
all_props = filenames.map { |fn| file_properties(fn) } | |
int_props = all_props.find_all { |p| interesting?(p) }.to_a | |
puts "NORMAL" | |
puts int_props.size | |
all_props_lazy = filenames.lazy.map { |fn| file_properties(fn) } | |
int_props_lazy = all_props_lazy.find_all { |p| interesting?(p) }.to_a | |
puts "LAZY" | |
puts int_props_lazy.size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment