Method: FileTransfer::Ftp#exist?

Defined in:
lib/file_transfer/ftp.rb

#exist?(file_path) ⇒ Boolean

Checks if file exists on FTP server

Parameters:

  • path to check

Returns:

  • true if file exists, otherwise false



71
72
73
74
75
76
# File 'lib/file_transfer/ftp.rb', line 71

def exist?(file_path)
  open_connection(60) do
    result = ftp.list "#{file_path}"
    result && result.size > 0
  end
end