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

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

vidur punj
  • 5,019
  • 4
  • 46
  • 65

1 Answers1

4

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.

Peter Huene
  • 5,758
  • 2
  • 34
  • 35