Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ab76af3d
Commit
ab76af3d
authored
Dec 03, 1997
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide default for blocksize on retrbinary (Skip Montanaro).
parent
98ee50b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
9 deletions
+11
-9
Doc/lib/libftplib.tex
Doc/lib/libftplib.tex
+5
-4
Doc/libftplib.tex
Doc/libftplib.tex
+5
-4
Lib/ftplib.py
Lib/ftplib.py
+1
-1
No files found.
Doc/lib/libftplib.tex
View file @
ab76af3d
...
...
@@ -125,14 +125,15 @@ Return nothing if a response code in the range 200--299 is received.
Raise an exception otherwise.
\end{funcdesc}
\begin{funcdesc}
{
retrbinary
}{
command
\,
callback
\
,
maxblocksize
}
\begin{funcdesc}
{
retrbinary
}{
command
\,
callback
\
optional
{
\,
maxblocksize
}
}
Retrieve a file in binary transfer mode.
\var
{
command
}
should be an
appropriate
\samp
{
RETR
}
command, i.e.
\ \code
{
"RETR
\var
{
filename
}
"
}
.
The
\var
{
callback
}
function is called for each block of data received,
with a single string argument giving the data block.
The
\var
{
maxblocksize
}
argument specifies the maximum block size
(which may not be the actual size of the data blocks passed to
\var
{
callback
}
).
The optional
\var
{
maxblocksize
}
argument specifies the maximum chunk size to
read on the low-level socket object created to do the actual transfer
(which will also be the largest size of the data blocks passed to
\var
{
callback
}
). A reasonable default is chosen.
\end{funcdesc}
\begin{funcdesc}
{
retrlines
}{
command
\optional
{
\,
callback
}}
...
...
Doc/libftplib.tex
View file @
ab76af3d
...
...
@@ -125,14 +125,15 @@ Return nothing if a response code in the range 200--299 is received.
Raise an exception otherwise.
\end{funcdesc}
\begin{funcdesc}
{
retrbinary
}{
command
\,
callback
\
,
maxblocksize
}
\begin{funcdesc}
{
retrbinary
}{
command
\,
callback
\
optional
{
\,
maxblocksize
}
}
Retrieve a file in binary transfer mode.
\var
{
command
}
should be an
appropriate
\samp
{
RETR
}
command, i.e.
\ \code
{
"RETR
\var
{
filename
}
"
}
.
The
\var
{
callback
}
function is called for each block of data received,
with a single string argument giving the data block.
The
\var
{
maxblocksize
}
argument specifies the maximum block size
(which may not be the actual size of the data blocks passed to
\var
{
callback
}
).
The optional
\var
{
maxblocksize
}
argument specifies the maximum chunk size to
read on the low-level socket object created to do the actual transfer
(which will also be the largest size of the data blocks passed to
\var
{
callback
}
). A reasonable default is chosen.
\end{funcdesc}
\begin{funcdesc}
{
retrlines
}{
command
\optional
{
\,
callback
}}
...
...
Lib/ftplib.py
View file @
ab76af3d
...
...
@@ -317,7 +317,7 @@ class FTP:
raise
error_reply
,
resp
return
resp
def
retrbinary
(
self
,
cmd
,
callback
,
blocksize
):
def
retrbinary
(
self
,
cmd
,
callback
,
blocksize
=
8192
):
'''Retrieve data in binary mode.
The argument is a RETR command.
The callback function is called for each block.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment