Module: Ftpd::DiskFileSystem::Write

Includes:
TranslateExceptions
Included in:
Ftpd::DiskFileSystem
Defined in:
lib/ftpd/disk_file_system.rb

Overview

DiskFileSystem mixin providing file writing

Instance Method Summary collapse

Methods included from TranslateExceptions

included, #translate_exception

Instance Method Details

#write(ftp_path, contents) ⇒ Object

Write a file to disk.

Called for:

  • STOR

  • STOU

If missing, then these commands are not supported.



145
146
147
148
149
# File 'lib/ftpd/disk_file_system.rb', line 145

def write(ftp_path, contents)
  File.open(expand_ftp_path(ftp_path), 'wb') do |file|
    file.write contents
  end
end