Class: Ftpd::DiskFileSystem
- Inherits:
-
Object
- Object
- Ftpd::DiskFileSystem
- Defined in:
- lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb,
lib/ftpd/disk_file_system.rb
Overview
An FTP file system mapped to a disk directory. This can serve as a template for creating your own specialized driver.
Any method may raise a PermanentFileSystemError (e.g. “file not found”) or TransientFileSystemError (e.g. “file busy”). A PermanentFileSystemError will cause a “550” error response to be sent; a TransientFileSystemError will cause a “450” error response to be sent. Methods may also raise an FtpServerError with any desired error code.
The class is divided into modules that may be included piecemeal. By including some mixins and not others, you can compose a disk file system driver “a la carte.” This is useful if you want an FTP server that, for example, allows reading but not writing files.
Defined Under Namespace
Modules: Accessors, Append, Base, Delete, FileWriting, List, Mkdir, PathExpansion, Read, Rename, Rmdir, Write
Instance Method Summary collapse
-
#initialize(data_dir) ⇒ DiskFileSystem
constructor
Make a new instance to serve a directory.
Methods included from Write
Methods included from TranslateExceptions
included, #translate_exception
Methods included from FileWriting
Methods included from Rmdir
Methods included from Rename
Methods included from Read
Methods included from Mkdir
Methods included from List
Methods included from Delete
Methods included from Append
Methods included from PathExpansion
#expand_ftp_path, #set_data_dir
Methods included from Accessors
#accessible?, #directory?, #exists?
Constructor Details
#initialize(data_dir) ⇒ DiskFileSystem
Make a new instance to serve a directory. data_dir should be an absolute path.
408 409 410 411 |
# File 'lib/ftpd/disk_file_system.rb', line 408 def initialize(data_dir) set_data_dir data_dir translate_exception SystemCallError end |