Module: Ftpd::DiskFileSystem::FileWriting

Included in:
Append, Write
Defined in:
lib/ftpd/disk_file_system.rb

Overview

DiskFileSystem mixin for writing files. Used by Append and Write.

Instance Method Summary collapse

Instance Method Details

#write_file(ftp_path, stream, mode) ⇒ Object



80
81
82
83
84
85
86
# File 'lib/ftpd/disk_file_system.rb', line 80

def write_file(ftp_path, stream, mode)
  File.open(expand_ftp_path(ftp_path), mode) do |file|
    while line = stream.read
      file.write line
    end
  end
end