Project

General

Profile

Actions

Feature #12966

closed

net/ftp to include fxp support?

Added by solebox (sole box) over 7 years ago. Updated about 2 years ago.

Status:
Rejected
Target version:
-
[ruby-core:78241]

Description

can we implement support for fxp ? its an extension of the ftp protocol , looks like a legit thing to have no?

Updated by duerst (Martin Dürst) over 7 years ago

  • Assignee deleted (core)

sole box wrote:

can we implement support for fxp ? its an extension of the ftp protocol , looks like a legit thing to have no?

Probably yes. Why don't you (or somebody else) go ahead and implement it, maybe as a gem, and then we can have a look at it?

BTW, please never assign any item to "ruby-core". It will only clutter everybody's list of assigned items, without anybody feeling responsible in particular.

Updated by solebox (sole box) over 7 years ago

Martin Dürst wrote:

sole box wrote:

can we implement support for fxp ? its an extension of the ftp protocol , looks like a legit thing to have no?

Probably yes. Why don't you (or somebody else) go ahead and implement it, maybe as a gem, and then we can have a look at it?

BTW, please never assign any item to "ruby-core". It will only clutter everybody's list of assigned items, without anybody feeling responsible in particular.

ok martin,
ill implement it gladly , btw , who do i assign it to then?

Updated by duerst (Martin Dürst) over 7 years ago

sole box wrote:

Martin Dürst wrote:

BTW, please never assign any item to "ruby-core". It will only clutter everybody's list of assigned items, without anybody feeling responsible in particular.

ok martin,
ill implement it gladly

Great!

btw , who do i assign it to then?

See https://bugs.ruby-lang.org/projects/ruby/wiki/MaintainersStdlib.

Updated by shugo (Shugo Maeda) over 7 years ago

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

sole box wrote:

can we implement support for fxp ? its an extension of the ftp protocol , looks like a legit thing to have no?

Do you have a specific interface in mind?
I came up with the following interface, but there may be a better interface or name.

class Net::FTP
  # PoC code without error check
  def self.exchange_file(dst_ftp, dst_file, src_ftp, src_file)
    host, port = dst_ftp.send(:makepasv)
    src_ftp.send(:sendport, host, port)
    th = Thread.start {
      dst_ftp.sendcmd("STOR #{dst_file}")
      dst_ftp.send(:voidresp)
    }
    src_ftp.sendcmd("RETR #{src_file}")
    src_ftp.send(:voidresp)
    th.join
  end
end

Net::FTP.open(dst_host, username: dst_user, password: dst_pass) do |dst_ftp|
  Net::FTP.open(src_host, username: src_user, password: src_pass) do |src_ftp|
    Net::FTP.exchange_file(dst_ftp, dst_file, src_ftp, src_file)
  end
end

It's better to support SSCN (Net::FTP#sscn), but I don't know the relationship
between SSCN and RFC 4217.
Is there any written specification of SSCN?

Updated by shugo (Shugo Maeda) over 7 years ago

Shugo Maeda wrote:

class Net::FTP
  # PoC code without error check
  def self.exchange_file(dst_ftp, dst_file, src_ftp, src_file)

It might be better to swap dst_* and src_*.

Updated by shugo (Shugo Maeda) about 2 years ago

  • Status changed from Assigned to Rejected

net/ftp is now a bundled gem, so I close this issue.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0