RemoteFileSelect.pm--Browse directories with FTP.


  use Tk::RemoteFileSelect;
  use Tk::LoginDialog;
  my $dialog;  # Reference to RemoteFileSelect widget.
  my $file;    # File selected in the widget.
  $dialog = $mw -> RemoteFileSelect( -directory => '.' );
  $file = $dialog -> Show;


A RemoteFileSelect dialog contains two Listboxes that display subdirectories and files, a directory Entry and a file name Entry, and buttons for each operation that are labeled with Alt-key accelerators.

When you select a file in the Listbox, RemoteFileSelect returns that file's name when you click on the ``Accept'' button. RemoteFileSelect also returns a file name if you press Enter after typing a name in the file Entry, or double click on a selection in the file Listbox.

Before returning the filename, RemoteFileSelect verifies whether the file exists.

If Net::FTP, part of libnet, is installed, RemoteFileSelect activates an additional ``Host'' button. Clicking ``Host'' prompts you for the name of a remote system, and your user name and password. After logging in with FTP, you can browse and select files on the remote system.

If a file name is selected on the local system, then RemoteFileSelect returns the path to the file, the same as a standard FileSelect widget.

If a file is selected on a remote host, then RemoteFileSelect returns the name in the form:


If RemoteFileSelect cannot find and load Net::FTP, the dialog box behaves like a standard FileSelect widget, and the ``Host'' button is grayed out.

RemoteFileSelect.pm was developed with the Net::FTP module distributed with libnet-1.12, from http://www.cpan.org/.

All other operations perform as in a Tk::FileSelect widget. Please refer to the Tk::FileSelect man page.


  $Revision: 0.59 $


Robert Allan Kiesling <rkiesling@earthlink.net>