aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-23 00:03:27 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-23 00:03:27 +0000
commit0379087f09c881792fdbb51858d8527d55be6ce8 (patch)
tree7ba1bf60bf4204ca323f0028cd37eaaaf09bc7d9 /lib
parent077e00c179c234cbe8db5c8838d541e441e33635 (diff)
downloadruby-0379087f09c881792fdbb51858d8527d55be6ce8.tar.gz
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')
-rw-r--r--lib/net/ftp.rb10
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