Class | TMail::FilePort |
In: |
lib/tmail/port.rb
|
Parent: | Port |
filename | -> | ident |
filename | [R] |
# File lib/tmail/port.rb, line 50 def initialize( fname ) @filename = File.expand_path(fname) super() end
# File lib/tmail/port.rb, line 59 def ==( other ) other.respond_to?(:filename) and @filename == other.filename end
# File lib/tmail/port.rb, line 117 def copy_to( port ) if FilePort === port copy_file @filename, port.filename else File.open(@filename) {|r| port.wopen {|w| while s = r.sysread(4096) w.write << s end } } end end
# File lib/tmail/port.rb, line 106 def move_to( port ) begin File.link @filename, port.filename rescue Errno::EXDEV copy_to port end File.unlink @filename end