diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-23 00:03:27 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-23 00:03:27 +0000 |
commit | e50266f299758a49d8933f4023803470c5f09943 (patch) | |
tree | 7ba1bf60bf4204ca323f0028cd37eaaaf09bc7d9 /lib/net | |
parent | 5660bb929f6d9124cce46cd95f54fa0db30431ed (diff) |
Add a new optinal argument pathname to FTP#stat.
Based on the patch by soleboxy.
[Fix GH-1478] [ruby-core:78240] [Feature #12965]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net')
-rw-r--r-- | lib/net/ftp.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index bb280139db..9f2f76fb1d 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -1226,11 +1226,13 @@ module Net # # Returns the status (STAT command). + # pathname - when stat is invoked with pathname as a parameter it acts like + # list but alot faster and over the same tcp session. # - def status - line = "STAT" + CRLF - print "put: STAT\n" if @debug_mode - @sock.send(line, Socket::MSG_OOB) + def status(pathname = nil) + line = pathname ? "STAT #{pathname}" : "STAT" + print "put: #{line}\n" if @debug_mode + @sock.send(line + CRLF, Socket::MSG_OOB) return getresp end |