summaryrefslogtreecommitdiff
path: root/lib/net/ftp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/ftp.rb')
-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