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.


25
26
27
# File 'lib/ftpd/disk_file_system.rb', line 25

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.


15
16
17
# File 'lib/ftpd/disk_file_system.rb', line 15

def set_data_dir(data_dir)
  @data_dir = data_dir
end