Sha256: dcc0d2f54cae492dabaaf31587e7f935b98d7833624848040a3b1e15f89ffc28
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
require "net/ftp" require "Titania/version" module Titania class Connection attr_accessor :connect def initialize(host,username,password) self.connect = Net::FTP::newhost, username, password) end def get_list(path = '/') # File List / Return Array result = self.connect.list(path) end def current_dir # get current dir self.connect.pwd end def change_dir(path) # Change dir self.connect.chdir(path) end def delete_file(path, file_name) # Delete file self.connect.delete(path + "/" + file_name) end def create_dir(path, dir_name) # Create dir self.connect.mkdir(path + "/" + dir_name) end def help(argv = nil) # Help cmd = "HELP" if argv cmd = cmd + " " + argv end self.connect.sendcmd(cmd) end def change_name(f_name, c_name) # Change file or directory name self.connect.rename(f_name, c_name) end def remove_dir(dir) # Remove dir self.connect.rmdir(dir) end def file_size(file) # Get File Size self.connect.size(file) end def connection_status # Connection status if self.connect.closed? puts "Connection is closed !" else puts "Connection is active !" end end def close # close connection self.connect.close end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
Titania-0.0.9 | lib/Titania.rb |