summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-13 00:26:51 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-06-13 00:26:51 +0000
commita5684ed234d6e5d24da356d5f35e2ceb910f260f (patch)
tree08b100a58ad59396d4f92e17e2ae62e25ade61a1
parentcc588e492cb9e5ffb5a7291ce4bcd3e281c228f2 (diff)
downloadruby-a5684ed234d6e5d24da356d5f35e2ceb910f260f.tar.gz
ruby-a5684ed234d6e5d24da356d5f35e2ceb910f260f.tar.xz
ruby-a5684ed234d6e5d24da356d5f35e2ceb910f260f.zip
* lib/net/ftp.rb (storebinary): seek correctly. Thanks, William Webber.
* lib/net/ftp.rb (putbinaryfile): rescue FTPPermError. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/net/ftp.rb9
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 58958451d..852244c71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 13 09:24:39 2003 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (storebinary): seek correctly. Thanks, William Webber.
+
+ * lib/net/ftp.rb (putbinaryfile): rescue FTPPermError.
+
Tue Jun 10 14:26:30 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* ext/syck/token.c: preserve newlines prepended to a block.
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index 5a08e4628..b34c648bf 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -407,6 +407,9 @@ module Net
# the data, in chunks of +blocksize+ characters.
#
def storbinary(cmd, file, blocksize, rest_offset = nil, &block) # :yield: data
+ if rest_offset
+ file.seek(rest_offset, IO::SEEK_SET)
+ end
synchronize do
voidcmd("TYPE I")
conn = transfercmd(cmd, rest_offset)
@@ -509,7 +512,11 @@ module Net
def putbinaryfile(localfile, remotefile = File.basename(localfile),
blocksize = DEFAULT_BLOCKSIZE, &block) # :yield: line/data
if @resume
- rest_offset = size(remotefile)
+ begin
+ rest_offset = size(remotefile)
+ rescue Net::FTPPermError
+ rest_offset = nil
+ end
else
rest_offset = nil
end