From: takaoueda@... Date: 2000-12-28T08:10:02+09:00 Subject: [ruby-talk:8146] Re: New to Ruby In article , Dave Thomas wrote: > > Hope this helps > Thanks a lot! That's clear and simple. Now I am in page 92. I wrote and ran the following program named "rescue.rb" to complete the code snippets in this page, but the program can not exit from the while loop, What is wrong? require 'socket' socket = TCPSocket.new('localhost','ftp') opName = "ftpfile" opFile = File.open(opName, 'w') begin while data = socket.read(16) opFile.write(data) end rescue SystemCallError $stderr.print "IO failed: " + $! opFile.close File.delete(opName) raise end When I forced the program to terminate by pressing CTRL + c, the message said, "rescue.rb:7: in `read': Interrupt from rescue.rb:7" The file "ftpfile" was created and contained one line "220 takaolap.wood.com FTP server (Version wu-2.6. Opere2(1) Mon Sep 20 15:04:49 PDT 1999) ready." Sent via Deja.com http://www.deja.com/