Project

General

Profile

Feature #5779

Ruby-FTP - allow easy way to find out whether a remote target is a file or a directory

Added by shevegen (Robert A. Heiler) over 7 years ago. Updated over 7 years ago.

Status:
Rejected
Priority:
Normal
Target version:
-
[ruby-core:<unknown>]

Description

Hello.

The FTP documentation of Ruby is at:

http://www.ruby-doc.org/stdlib-1.9.3/libdoc/net/ftp/rdoc/index.html

When you have a local file on your HDD, you can do this:

File.directory? '/tmp' # => true
File.file? '/etc/ld.so.conf' # => true

I propose something like that to be added to the Ruby-FTP library too.

So that a user can find out whether something is a file or a directory,
without the need to download it, or parse the .list output manually.

This is mostly for convenience.

History

Updated by mame (Yusuke Endoh) over 7 years ago

  • Status changed from Open to Assigned
  • Assignee set to shugo (Shugo Maeda)

Maeda-san, please take a look at this.

--
Yusuke Endoh mame@tsg.ne.jp

Updated by shugo (Shugo Maeda) over 7 years ago

  • Status changed from Assigned to Rejected

shevegen (markus heiler) wrote:

When you have a local file on your HDD, you can do this:

File.directory? '/tmp' # => true
File.file? '/etc/ld.so.conf' # => true

I propose something like that to be added to the Ruby-FTP library too.

So that a user can find out whether something is a file or a directory,
without the need to download it, or parse the .list output manually.

RFC959 says that output of the LIST command is not designed to be machine readable:

        Since the information on a file may vary widely from system
        to system, this information may be hard to use automatically
        in a program, but may be quite useful to a human user.

The format is not specified in RFC959, and is platform-dependent.
I know that some programs such as wget parse output of the LIST command in a heuristic way, but I wouldn't like to implement it as a feature of Net::FTP.

Updated by naruse (Yui NARUSE) over 7 years ago

RFC 3659 extends ftp with MLST, the command to show the detail of directories,
but it is not widely implemented yet.

Also available in: Atom PDF