cURL / Mailing Lists / curl-library / Single Mail

curl-library

FTP of growing files?

From: Kurt Fankhauser <kurtbutfrank_at_gmail.com>
Date: Fri, 27 Feb 2015 17:29:16 -0800

Does libcurl support ftp download of growing files? I understand that this
requires support on the ftp server side to determine when the file has
stopped growing and the the transfer can complete.

From my debug logs it looks like libcurl reads the current size of the file
and then downloads exactly that many bytes:

02/27 16:31:05 D mf MFFtpClient: cURL: 220-Welcome to Pure-FTPd.
02/27 16:31:05 D mf MFFtpClient: cURL: 220-You are user number 3 of
60 allowed.
02/27 16:31:05 D mf MFFtpClient: cURL: 220-This is a private system -
No anonymous login
02/27 16:31:05 D mf MFFtpClient: cURL: 220 You will be disconnected
after 15 minutes of inactivity.
02/27 16:31:05 D mf MFFtpClient: cURL: USER user
02/27 16:31:05 D mf MFFtpClient: cURL: 331 User user OK. Password
required
02/27 16:31:05 D mf MFFtpClient: cURL: PASS user
02/27 16:31:05 I pure-ftp (?:23813_at_127.0.0.1) [INFO] user is now logged in
02/27 16:31:05 D mf MFFtpClient: cURL: 230-User user has group access
to: users
02/27 16:31:05 D mf MFFtpClient: cURL: 230-This server supports FXP
transfers
02/27 16:31:05 D mf MFFtpClient: cURL: 230 OK. Current restricted
directory is /
02/27 16:31:05 D mf MFFtpClient: cURL: PWD
02/27 16:31:05 D mf MFFtpClient: cURL: 257 "/" is your current
location
02/27 16:31:05 D mf MFFtpClient: cURL: Entry path is '/'
02/27 16:31:05 D mf MFFtpClient: cURL: CWD /fs0
02/27 16:31:05 D mf MFFtpClient: cURL: 250 OK. Current directory is
/fs0
02/27 16:31:05 D mf MFFtpClient: cURL: CWD clip.dir
02/27 16:31:05 D mf MFFtpClient: cURL: 250 OK. Current directory is
/fs0/clip.dir
02/27 16:31:05 D mf MFFtpClient: cURL: EPSV
02/27 16:31:05 D mf MFFtpClient: cURL: Connect data stream passively
02/27 16:31:05 D mf MFFtpClient: cURL: 229 Extended Passive mode OK
(|||46549|)
02/27 16:31:05 D mf MFFtpClient: cURL: Trying 127.0.0.1...
02/27 16:31:05 D mf MFFtpClient: cURL: connected
02/27 16:31:05 D mf MFFtpClient: cURL: Connecting to 127.0.0.1
(127.0.0.1) port 46549
02/27 16:31:05 D mf MFFtpClient: cURL: TYPE I
02/27 16:31:05 D mf MFFtpClient: cURL: 200 TYPE is now 8-bit binary
02/27 16:31:05 D mf MFFtpClient: cURL: SIZE grow.mxf
02/27 16:31:05 D mf MFFtpClient: cURL: 213 80216064
02/27 16:31:05 D mf MFFtpClient: cURL: RETR grow.mxf
02/27 16:31:05 D mf MFFtpClient: cURL: 150 Opening data connection
02/27 16:31:05 D mf MFFtpClient: cURL: Maxdownload = -1
02/27 16:31:05 D mf MFFtpClient: cURL: Getting file with size:
80216064
02/27 16:31:06 D mf MFFtpClient: cURL: Remembering we are in dir
"/fs0/clip.dir/"
02/27 16:31:06 I pure-ftp (user:23813_at_127.0.0.1) [INFO] sendfile: 32:
Broken pipe
02/27 16:31:06 I pure-ftp (user:23813_at_127.0.0.1) [INFO] Transfer aborted
02/27 16:31:07 D mf MFFtpClient: cURL: 450 Error during write to data
connection
02/27 16:31:07 D mf MFFtpClient: cURL: server did not report OK, got
450
02/27 16:31:07 D mf MFFtpClient: cURL: Connection #0 to host
localhost left intact
02/27 16:31:07 W mf MFFtpClient::TransferThread_: cURL result on
server Spect224-1: Transferred a partial file
02/27 16:31:07 D mf MFFtpClient: cURL: QUIT
02/27 16:31:07 I pure-ftp (user:23813_at_127.0.0.1) [INFO] Logout.
02/27 16:31:07 D mf MFFtpClient: cURL: 221-Goodbye. You uploaded 0
and downloaded 78405 kbytes.
02/27 16:31:07 D mf MFFtpClient: cURL: 221 Logout.
02/27 16:31:07 D mf MFFtpClient: cURL: Closing connection #0

The server (pure-ftp) tries to send additional bytes since the file has
grown in size, but libcurl has closed the data connection. Are there any
options available to allow the data connection to remain open until the
server determines completion?

I am using libcurl v7.20.0. My standard ubuntu linux command line ftp
client handles this situation fine and I believe this feature is referred
to as "tail mode".

Kurt

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-02-28