Module: Ftpd::DiskFileSystem::Read
- Includes:
- TranslateExceptions
- Included in:
- Ftpd::DiskFileSystem, ReadOnlyDiskFileSystem
- Defined in:
- lib/ftpd/disk_file_system.rb
Overview
DiskFileSystem mixin providing file reading
Instance Method Summary collapse
-
#read(ftp_path) {|io| ... } ⇒ Object
Read a file from disk.
Methods included from TranslateExceptions
included, #translate_exception
Instance Method Details
#read(ftp_path) {|io| ... } ⇒ Object
Read a file from disk. Called for:
-
RETR
If missing, then these commands are not supported.
131 132 133 134 135 136 137 138 |
# File 'lib/ftpd/disk_file_system.rb', line 131 def read(ftp_path, &block) io = File.open((ftp_path), 'rb') begin yield(io) ensure io.close end end |