From: "shugo (Shugo Maeda)" Date: 2012-03-31T17:44:04+09:00 Subject: [ruby-core:43995] [ruby-trunk - Feature #5779][Rejected] Ruby-FTP - allow easy way to find out whether a remote target is a file or a directory Issue #5779 has been updated by shugo (Shugo Maeda). 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. ---------------------------------------- Feature #5779: Ruby-FTP - allow easy way to find out whether a remote target is a file or a directory https://bugs.ruby-lang.org/issues/5779#change-25517 Author: shevegen (markus heiler) Status: Rejected Priority: Low Assignee: shugo (Shugo Maeda) Category: Target version: 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. -- http://bugs.ruby-lang.org/