vidur punj
vidur punj

Reputation: 5871

NET::FTP ruby on rails vist parent directory?

a=Net::FTP.open('path', 'username','password')
a.chdir('any name of directory')

But how to visit the parent directory from a.pwd()

Upvotes: 3

Views: 275

Answers (1)

user530189
user530189

Reputation:

Use a.chdir('..') to change to the parent directory if the host platform supports it (pretty much all platforms should) or use a.sendcmd('CDUP') to change to the parent directory in a platform-agnostic way.

Upvotes: 4

Related Questions