Skip to content

Commit

Permalink
Added default blocksize to Net::FTP#getbinaryfile
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
shugo committed Aug 17, 2000
1 parent 79c2d60 commit 468df0e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/net/ftp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class FTP

FTP_PORT = 21
CRLF = "\r\n"

DEFAULT_BLOCKSIZE = 4096

attr_accessor :passive, :return_code, :debug_mode, :resume
attr_reader :welcome, :lastresp
Expand Down Expand Up @@ -338,7 +340,8 @@ def storlines(cmd, file, callback = nil)
end
end

def getbinaryfile(remotefile, localfile, blocksize, callback = nil)
def getbinaryfile(remotefile, localfile,
blocksize = DEFAULT_BLOCKSIZE, callback = nil)
if iterator?
callback = Proc.new
end
Expand Down Expand Up @@ -378,7 +381,8 @@ def gettextfile(remotefile, localfile, callback = nil)
end
end

def putbinaryfile(localfile, remotefile, blocksize = 4096, callback = nil)
def putbinaryfile(localfile, remotefile,
blocksize = DEFAULT_BLOCKSIZE, callback = nil)
if iterator?
callback = Proc.new
end
Expand Down

0 comments on commit 468df0e

Please sign in to comment.