Module: Ftpd::DiskFileSystem::PathExpansion

Included in:
Base
Defined in:
lib/ftpd/disk_file_system.rb

Overview

DiskFileSystem mixin for path expansion. Used by every command that accesses the disk file system.

Instance Method Summary collapse

Instance Method Details

#expand_ftp_path(ftp_path) ⇒ Object

Expand an ftp_path to an absolute file system path.

ftp_path is an absolute path relative to the FTP file system. The return value is an absolute path relative to the disk file system.



27
28
29
# File 'lib/ftpd/disk_file_system.rb', line 27

def expand_ftp_path(ftp_path)
  File.expand_path(File.join(@data_dir, ftp_path))
end

#set_data_dir(data_dir) ⇒ Object

Set the data directory, the root of the disk file system. data_dir should be an absolute path.



17
18
19
# File 'lib/ftpd/disk_file_system.rb', line 17

def set_data_dir(data_dir)
  @data_dir = data_dir
end