Skip to content

Instantly share code, notes, and snippets.

@hmsk
Created May 6, 2010 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hmsk/391724 to your computer and use it in GitHub Desktop.
Save hmsk/391724 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/ruby
ARGV.each do |f|
read_size = 0
io = File.open f
print "#{f} :\n"
while (s = io.sysread(32768) rescue nil) do
read_size += s.size
STDERR.print "#{read_size} bytes read \r"
end
print "#{read_size} bytes read complete\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment