# "closed stream" problem

**URL:** <https://www.ruby-forum.com/t/closed-stream-problem/154121>\
**Category:** Ruby\
**Created:** [November 25, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/closed-stream-problem/154121 "2008-11-25T16:36:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodikp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e79b87/32.png) [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Post date:** [November 25, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/closed-stream-problem/154121/1 "2008-11-25T16:36:30Z")

</div>

Hi,  
Can someone please help me with this error? It gives an exception of a  
“closed stream.” What is that? I see that it’s failing where it’s  
supposed to ftp over a file.

I’m being asked to send over .success and/or .error files for image  
files I’m processing. I can see that the error file for this image has  
been created. That’s good. I see the file in the directory. But, it just  
fails when it’s supposed to ftp the file over. It had already succeeded  
in ftp’ing over previous .success files, just not .error files like this  
one.

Thanks,  
Peter

================ IOError =====================  
E:\live\ruby\lib\ruby\1.8/net/ftp.rb:206:in `write' @sock.write(line) E:\live\ruby\lib\ruby\1.8/net/ftp.rb:206:in`putline’  
@sock.write(line)  
E:\live\ruby\lib\ruby\1.8/net/ftp.rb:273:in `voidcmd' putline(cmd) E:\live\ruby\lib\ruby\1.8/monitor.rb:242:in`synchronize’  
yield  
E:\live\ruby\lib\ruby\1.8/net/ftp.rb:272:in `voidcmd' synchronize do E:\live\ruby\lib\ruby\1.8/net/ftp.rb:448:in`storbinary’  
voidcmd(“TYPE I”)  
E:\live\ruby\lib\ruby\1.8/monitor.rb:242:in `synchronize' yield E:\live\ruby\lib\ruby\1.8/net/ftp.rb:447:in`storbinary’  
synchronize do  
E:\live\ruby\lib\ruby\1.8/net/ftp.rb:559:in `putbinaryfile' storbinary("STOR " + remotefile, f, blocksize, rest_offset, &block) E:\live\scripts\RUBY\images\process_cfr2.rb:159 ftp.putbinaryfile(fileerror) E:\live\scripts\RUBY\images\process_cfr2.rb:35:in`each’  
Dir.glob("_.gif").each do |giffile|  
E:\live\scripts\RUBY\images\process\_cfr2.rb:35  
Dir.glob("_.gif").each do |giffile|

=============================================  
Exception: closed stream
