Open rileytb opened 7 years ago
begin
# Exceptions raised by this code will
# be caught by the following rescue clause
while data = socket.read(512)
opFile.write(data)
end
rescue SystemCallError
$stderr.print "IO failed: " + $!
opFile.close
File.delete(opName)
raise
end
https://github.com/rileytb/ruby_file_filter/blob/4c07bd0bbcd1d7fdffe341be3bb6e3d3a26c8289/filter.rb#L170