14ca1ab94SDag-Erling Smørgrav.\" Copyright (c) 1998 Dag-Erling Co�dan Sm�rgrav 24ca1ab94SDag-Erling Smørgrav.\" All rights reserved. 34ca1ab94SDag-Erling Smørgrav.\" 44ca1ab94SDag-Erling Smørgrav.\" Redistribution and use in source and binary forms, with or without 54ca1ab94SDag-Erling Smørgrav.\" modification, are permitted provided that the following conditions 64ca1ab94SDag-Erling Smørgrav.\" are met: 74ca1ab94SDag-Erling Smørgrav.\" 1. Redistributions of source code must retain the above copyright 84ca1ab94SDag-Erling Smørgrav.\" notice, this list of conditions and the following disclaimer. 94ca1ab94SDag-Erling Smørgrav.\" 2. Redistributions in binary form must reproduce the above copyright 104ca1ab94SDag-Erling Smørgrav.\" notice, this list of conditions and the following disclaimer in the 114ca1ab94SDag-Erling Smørgrav.\" documentation and/or other materials provided with the distribution. 124ca1ab94SDag-Erling Smørgrav.\" 134ca1ab94SDag-Erling Smørgrav.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 144ca1ab94SDag-Erling Smørgrav.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 154ca1ab94SDag-Erling Smørgrav.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 164ca1ab94SDag-Erling Smørgrav.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 174ca1ab94SDag-Erling Smørgrav.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 184ca1ab94SDag-Erling Smørgrav.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 194ca1ab94SDag-Erling Smørgrav.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 204ca1ab94SDag-Erling Smørgrav.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 214ca1ab94SDag-Erling Smørgrav.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 224ca1ab94SDag-Erling Smørgrav.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 234ca1ab94SDag-Erling Smørgrav.\" SUCH DAMAGE. 244ca1ab94SDag-Erling Smørgrav.\" 257f3dea24SPeter Wemm.\" $FreeBSD$ 264ca1ab94SDag-Erling Smørgrav.\" 274ca1ab94SDag-Erling Smørgrav.Dd July 1, 1998 284ca1ab94SDag-Erling Smørgrav.Dt FETCH 3 294ca1ab94SDag-Erling Smørgrav.Os 304ca1ab94SDag-Erling Smørgrav.Sh NAME 319a964d6aSDag-Erling Smørgrav.Nm fetchMakeURL , 3260245e42SDag-Erling Smørgrav.Nm fetchParseURL , 3360245e42SDag-Erling Smørgrav.Nm fetchFreeURL , 341a5faa10SDag-Erling Smørgrav.Nm fetchXGetURL , 354ca1ab94SDag-Erling Smørgrav.Nm fetchGetURL , 364ca1ab94SDag-Erling Smørgrav.Nm fetchPutURL , 37d8acd8dcSDag-Erling Smørgrav.Nm fetchStatURL , 38ce71b736SDag-Erling Smørgrav.Nm fetchListURL , 391a5faa10SDag-Erling Smørgrav.Nm fetchXGet , 40db5f8cebSDag-Erling Smørgrav.Nm fetchGet , 41db5f8cebSDag-Erling Smørgrav.Nm fetchPut , 42d8acd8dcSDag-Erling Smørgrav.Nm fetchStat , 43ce71b736SDag-Erling Smørgrav.Nm fetchList , 441a5faa10SDag-Erling Smørgrav.Nm fetchXGetFile , 454ca1ab94SDag-Erling Smørgrav.Nm fetchGetFile , 464ca1ab94SDag-Erling Smørgrav.Nm fetchPutFile , 47d8acd8dcSDag-Erling Smørgrav.Nm fetchStatFile , 48ce71b736SDag-Erling Smørgrav.Nm fetchListFile , 491a5faa10SDag-Erling Smørgrav.Nm fetchXGetHTTP , 504ca1ab94SDag-Erling Smørgrav.Nm fetchGetHTTP , 514ca1ab94SDag-Erling Smørgrav.Nm fetchPutHTTP , 52d8acd8dcSDag-Erling Smørgrav.Nm fetchStatHTTP , 53ce71b736SDag-Erling Smørgrav.Nm fetchListHTTP , 541a5faa10SDag-Erling Smørgrav.Nm fetchXGetFTP , 554ca1ab94SDag-Erling Smørgrav.Nm fetchGetFTP , 5615efcd39SAlexey Zelkin.Nm fetchPutFTP , 5715efcd39SAlexey Zelkin.Nm fetchStatFTP , 5815efcd39SAlexey Zelkin.Nm fetchListFTP 5915efcd39SAlexey Zelkin.Nd file transfer functions 6015efcd39SAlexey Zelkin.Sh LIBRARY 6115efcd39SAlexey Zelkin.Lb libfetch 624ca1ab94SDag-Erling Smørgrav.Sh SYNOPSIS 6332eef9aeSRuslan Ermilov.In sys/param.h 6432eef9aeSRuslan Ermilov.In stdio.h 6532eef9aeSRuslan Ermilov.In fetch.h 6660245e42SDag-Erling Smørgrav.Ft struct url * 6738c7e4a6SArchie Cobbs.Fn fetchMakeURL "const char *scheme" "const char *host" "int port" "const char *doc" "const char *user" "const char *pwd" 689a964d6aSDag-Erling Smørgrav.Ft struct url * 6938c7e4a6SArchie Cobbs.Fn fetchParseURL "const char *URL" 7060245e42SDag-Erling Smørgrav.Ft void 7138c7e4a6SArchie Cobbs.Fn fetchFreeURL "struct url *u" 72db5f8cebSDag-Erling Smørgrav.Ft FILE * 7338c7e4a6SArchie Cobbs.Fn fetchXGetURL "const char *URL" "struct url_stat *us" "const char *flags" 741a5faa10SDag-Erling Smørgrav.Ft FILE * 7538c7e4a6SArchie Cobbs.Fn fetchGetURL "const char *URL" "const char *flags" 76db5f8cebSDag-Erling Smørgrav.Ft FILE * 7738c7e4a6SArchie Cobbs.Fn fetchPutURL "const char *URL" "const char *flags" 78d8acd8dcSDag-Erling Smørgrav.Ft int 7938c7e4a6SArchie Cobbs.Fn fetchStatURL "const char *URL" "struct url_stat *us" "const char *flags" 80ce71b736SDag-Erling Smørgrav.Ft struct url_ent * 8138c7e4a6SArchie Cobbs.Fn fetchListURL "const char *URL" "const char *flags" 824ca1ab94SDag-Erling Smørgrav.Ft FILE * 8338c7e4a6SArchie Cobbs.Fn fetchXGet "struct url *u" "struct url_stat *us" "const char *flags" 841a5faa10SDag-Erling Smørgrav.Ft FILE * 8538c7e4a6SArchie Cobbs.Fn fetchGet "struct url *u" "const char *flags" 86db5f8cebSDag-Erling Smørgrav.Ft FILE * 8738c7e4a6SArchie Cobbs.Fn fetchPut "struct url *u" "const char *flags" 88d8acd8dcSDag-Erling Smørgrav.Ft int 8938c7e4a6SArchie Cobbs.Fn fetchStat "struct url *u" "struct url_stat *us" "const char *flags" 90ce71b736SDag-Erling Smørgrav.Ft struct url_ent * 9138c7e4a6SArchie Cobbs.Fn fetchList "struct url *u" "const char *flags" 92db5f8cebSDag-Erling Smørgrav.Ft FILE * 9338c7e4a6SArchie Cobbs.Fn fetchXGetFile "struct url *u" "struct url_stat *us" "const char *flags" 941a5faa10SDag-Erling Smørgrav.Ft FILE * 9538c7e4a6SArchie Cobbs.Fn fetchGetFile "struct url *u" "const char *flags" 964ca1ab94SDag-Erling Smørgrav.Ft FILE * 9738c7e4a6SArchie Cobbs.Fn fetchPutFile "struct url *u" "const char *flags" 98d8acd8dcSDag-Erling Smørgrav.Ft int 9938c7e4a6SArchie Cobbs.Fn fetchStatFile "struct url *u" "struct url_stat *us" "const char *flags" 100ce71b736SDag-Erling Smørgrav.Ft struct url_ent * 10138c7e4a6SArchie Cobbs.Fn fetchListFile "struct url *u" "const char *flags" 1024ca1ab94SDag-Erling Smørgrav.Ft FILE * 10338c7e4a6SArchie Cobbs.Fn fetchXGetHTTP "struct url *u" "struct url_stat *us" "const char *flags" 1041a5faa10SDag-Erling Smørgrav.Ft FILE * 10538c7e4a6SArchie Cobbs.Fn fetchGetHTTP "struct url *u" "const char *flags" 1064ca1ab94SDag-Erling Smørgrav.Ft FILE * 10738c7e4a6SArchie Cobbs.Fn fetchPutHTTP "struct url *u" "const char *flags" 108d8acd8dcSDag-Erling Smørgrav.Ft int 10938c7e4a6SArchie Cobbs.Fn fetchStatHTTP "struct url *u" "struct url_stat *us" "const char *flags" 110ce71b736SDag-Erling Smørgrav.Ft struct url_ent * 11138c7e4a6SArchie Cobbs.Fn fetchListHTTP "struct url *u" "const char *flags" 1124ca1ab94SDag-Erling Smørgrav.Ft FILE * 11338c7e4a6SArchie Cobbs.Fn fetchXGetFTP "struct url *u" "struct url_stat *us" "const char *flags" 1141a5faa10SDag-Erling Smørgrav.Ft FILE * 11538c7e4a6SArchie Cobbs.Fn fetchGetFTP "struct url *u" "const char *flags" 1164ca1ab94SDag-Erling Smørgrav.Ft FILE * 11738c7e4a6SArchie Cobbs.Fn fetchPutFTP "struct url *u" "const char *flags" 118d8acd8dcSDag-Erling Smørgrav.Ft int 11938c7e4a6SArchie Cobbs.Fn fetchStatFTP "struct url *u" "struct url_stat *us" "const char *flags" 120ce71b736SDag-Erling Smørgrav.Ft struct url_ent * 12138c7e4a6SArchie Cobbs.Fn fetchListFTP "struct url *u" "const char *flags" 1224ca1ab94SDag-Erling Smørgrav.Sh DESCRIPTION 1234ca1ab94SDag-Erling SmørgravThese functions implement a high-level library for retrieving and 1244ca1ab94SDag-Erling Smørgravuploading files using Uniform Resource Locators (URLs). 1254ca1ab94SDag-Erling Smørgrav.Pp 12660245e42SDag-Erling Smørgrav.Fn fetchParseURL 12760245e42SDag-Erling Smørgravtakes a URL in the form of a null-terminated string and splits it into 12860245e42SDag-Erling Smørgravits components function according to the Common Internet Scheme Syntax 1299364c532SDag-Erling Smørgravdetailed in RFC1738. 1309364c532SDag-Erling SmørgravA regular expression which produces this syntax is: 13160245e42SDag-Erling Smørgrav.Bd -literal 13260245e42SDag-Erling Smørgrav <scheme>:(//(<user>(:<pwd>)?@)?<host>(:<port>)?)?/(<document>)? 13360245e42SDag-Erling Smørgrav.Ed 13460245e42SDag-Erling Smørgrav.Pp 1351df2031cSDag-Erling SmørgravIf the URL does not seem to begin with a scheme name, the following 1361df2031cSDag-Erling Smørgravsyntax is assumed: 1371df2031cSDag-Erling Smørgrav.Bd -literal 1381df2031cSDag-Erling Smørgrav ((<user>(:<pwd>)?@)?<host>(:<port>)?)?/(<document>)? 1391df2031cSDag-Erling Smørgrav.Ed 1401df2031cSDag-Erling Smørgrav.Pp 14160245e42SDag-Erling SmørgravNote that some components of the URL are not necessarily relevant to 14260245e42SDag-Erling Smørgravall URL schemes. 1431df2031cSDag-Erling SmørgravFor instance, the file scheme only needs the <scheme> and <document> 1441df2031cSDag-Erling Smørgravcomponents. 14560245e42SDag-Erling Smørgrav.Pp 1469a964d6aSDag-Erling Smørgrav.Fn fetchMakeURL 1479a964d6aSDag-Erling Smørgravand 14840ac2845SDag-Erling Smørgrav.Fn fetchParseURL 1499a964d6aSDag-Erling Smørgravreturn a pointer to a 150a7e16a9dSRuslan Ermilov.Vt url 15140ac2845SDag-Erling Smørgravstructure, which is defined as follows in 15240ac2845SDag-Erling Smørgrav.Aq Pa fetch.h : 15340ac2845SDag-Erling Smørgrav.Bd -literal 15440ac2845SDag-Erling Smørgrav#define URL_SCHEMELEN 16 15540ac2845SDag-Erling Smørgrav#define URL_USERLEN 256 15640ac2845SDag-Erling Smørgrav#define URL_PWDLEN 256 15740ac2845SDag-Erling Smørgrav 15840ac2845SDag-Erling Smørgravstruct url { 15940ac2845SDag-Erling Smørgrav char scheme[URL_SCHEMELEN+1]; 16040ac2845SDag-Erling Smørgrav char user[URL_USERLEN+1]; 16140ac2845SDag-Erling Smørgrav char pwd[URL_PWDLEN+1]; 16240ac2845SDag-Erling Smørgrav char host[MAXHOSTNAMELEN+1]; 16340ac2845SDag-Erling Smørgrav int port; 16440ac2845SDag-Erling Smørgrav char *doc; 16540ac2845SDag-Erling Smørgrav off_t offset; 16640ac2845SDag-Erling Smørgrav size_t length; 16740ac2845SDag-Erling Smørgrav}; 16840ac2845SDag-Erling Smørgrav.Ed 16940ac2845SDag-Erling Smørgrav.Pp 17060245e42SDag-Erling SmørgravThe pointer returned by 1719a964d6aSDag-Erling Smørgrav.Fn fetchMakeURL 1729a964d6aSDag-Erling Smørgravor 17360245e42SDag-Erling Smørgrav.Fn fetchParseURL 17460245e42SDag-Erling Smørgravshould be freed using 17560245e42SDag-Erling Smørgrav.Fn fetchFreeURL . 17660245e42SDag-Erling Smørgrav.Pp 1771a5faa10SDag-Erling Smørgrav.Fn fetchXGetURL , 1781a5faa10SDag-Erling Smørgrav.Fn fetchGetURL , 179db5f8cebSDag-Erling Smørgravand 180db5f8cebSDag-Erling Smørgrav.Fn fetchPutURL 181db5f8cebSDag-Erling Smørgravconstitute the recommended interface to the 182db5f8cebSDag-Erling Smørgrav.Nm fetch 183c6ff3a1bSSheldon Hearnlibrary. 184c6ff3a1bSSheldon HearnThey examine the URL passed to them to determine the transfer 185db5f8cebSDag-Erling Smørgravmethod, and call the appropriate lower-level functions to perform the 186c6ff3a1bSSheldon Hearnactual transfer. 1871a5faa10SDag-Erling Smørgrav.Fn fetchXGetURL 1881a5faa10SDag-Erling Smørgravalso returns the remote document's metadata in the 189a7e16a9dSRuslan Ermilov.Vt url_stat 1901a5faa10SDag-Erling Smørgravstructure pointed to by the 1911a5faa10SDag-Erling Smørgrav.Fa us 1921a5faa10SDag-Erling Smørgravargument. 1931a5faa10SDag-Erling Smørgrav.Pp 194c6ff3a1bSSheldon HearnThe 195db5f8cebSDag-Erling Smørgrav.Fa flags 196c6ff3a1bSSheldon Hearnargument is a string of characters which specify transfer options. 197c6ff3a1bSSheldon HearnThe 198db5f8cebSDag-Erling Smørgravmeaning of the individual flags is scheme-dependent, and is detailed 199db5f8cebSDag-Erling Smørgravin the appropriate section below. 200db5f8cebSDag-Erling Smørgrav.Pp 201d8acd8dcSDag-Erling Smørgrav.Fn fetchStatURL 202d8acd8dcSDag-Erling Smørgravattempts to obtain the requested document's metadata and fill in the 2035e75e35cSDima Dorfmanstructure pointed to by its second argument. 204c6ff3a1bSSheldon HearnThe 205a7e16a9dSRuslan Ermilov.Vt url_stat 206d8acd8dcSDag-Erling Smørgravstructure is defined as follows in 207d8acd8dcSDag-Erling Smørgrav.Aq Pa fetch.h : 208d8acd8dcSDag-Erling Smørgrav.Bd -literal 209d8acd8dcSDag-Erling Smørgravstruct url_stat { 210d8acd8dcSDag-Erling Smørgrav off_t size; 2115aea254fSDag-Erling Smørgrav time_t atime; 2125aea254fSDag-Erling Smørgrav time_t mtime; 213d8acd8dcSDag-Erling Smørgrav}; 214d8acd8dcSDag-Erling Smørgrav.Ed 215d8acd8dcSDag-Erling Smørgrav.Pp 21640ac2845SDag-Erling SmørgravIf the size could not be obtained from the server, the 21740ac2845SDag-Erling Smørgrav.Fa size 21840ac2845SDag-Erling Smørgravfield is set to -1. 21940ac2845SDag-Erling SmørgravIf the modification time could not be obtained from the server, the 22040ac2845SDag-Erling Smørgrav.Fa mtime 22140ac2845SDag-Erling Smørgravfield is set to the epoch. 22240ac2845SDag-Erling SmørgravIf the access time could not be obtained from the server, the 22340ac2845SDag-Erling Smørgrav.Fa atime 22440ac2845SDag-Erling Smørgravfield is set to the modification time. 22540ac2845SDag-Erling Smørgrav.Pp 226ce71b736SDag-Erling Smørgrav.Fn fetchListURL 227ce71b736SDag-Erling Smørgravattempts to list the contents of the directory pointed to by the URL 228c6ff3a1bSSheldon Hearnprovided. 229c6ff3a1bSSheldon HearnIf successful, it returns a malloced array of 230a7e16a9dSRuslan Ermilov.Vt url_ent 231c6ff3a1bSSheldon Hearnstructures. 232c6ff3a1bSSheldon HearnThe 233a7e16a9dSRuslan Ermilov.Vt url_ent 234ce71b736SDag-Erling Smørgravstructure is defined as follows in 235ce71b736SDag-Erling Smørgrav.Aq Pa fetch.h : 236ce71b736SDag-Erling Smørgrav.Bd -literal 237ce71b736SDag-Erling Smørgravstruct url_ent { 238ce71b736SDag-Erling Smørgrav char name[MAXPATHLEN]; 239ce71b736SDag-Erling Smørgrav struct url_stat stat; 240ce71b736SDag-Erling Smørgrav}; 241ce71b736SDag-Erling Smørgrav.Ed 242ce71b736SDag-Erling Smørgrav.Pp 243ce71b736SDag-Erling SmørgravThe list is terminated by an entry with an empty name. 244ce71b736SDag-Erling Smørgrav.Pp 245ce71b736SDag-Erling SmørgravThe pointer returned by 246ce71b736SDag-Erling Smørgrav.Fn fetchListURL 247ce71b736SDag-Erling Smørgravshould be freed using 248ce71b736SDag-Erling Smørgrav.Fn free . 249ce71b736SDag-Erling Smørgrav.Pp 2501a5faa10SDag-Erling Smørgrav.Fn fetchXGet , 251d8acd8dcSDag-Erling Smørgrav.Fn fetchGet , 252db5f8cebSDag-Erling Smørgrav.Fn fetchPut 2534ca1ab94SDag-Erling Smørgravand 254d8acd8dcSDag-Erling Smørgrav.Fn fetchStat 255d8acd8dcSDag-Erling Smørgravare similar to 2561a5faa10SDag-Erling Smørgrav.Fn fetchXGetURL , 257d8acd8dcSDag-Erling Smørgrav.Fn fetchGetURL , 258d8acd8dcSDag-Erling Smørgrav.Fn fetchPutURL 259d8acd8dcSDag-Erling Smørgravand 260d8acd8dcSDag-Erling Smørgrav.Fn fetchStatURL , 261db5f8cebSDag-Erling Smørgravexcept that they expect a pre-parsed URL in the form of a pointer to 262d8acd8dcSDag-Erling Smørgrava 263a7e16a9dSRuslan Ermilov.Vt struct url 264d8acd8dcSDag-Erling Smørgravrather than a string. 2654ca1ab94SDag-Erling Smørgrav.Pp 2664ca1ab94SDag-Erling SmørgravAll of the 2671a5faa10SDag-Erling Smørgrav.Fn fetchXGetXXX , 2684ca1ab94SDag-Erling Smørgrav.Fn fetchGetXXX 2694ca1ab94SDag-Erling Smørgravand 2704ca1ab94SDag-Erling Smørgrav.Fn fetchPutXXX 2714ca1ab94SDag-Erling Smørgravfunctions return a pointer to a stream which can be used to read or 272c6ff3a1bSSheldon Hearnwrite data from or to the requested document, respectively. 273c6ff3a1bSSheldon HearnNote that 2744ca1ab94SDag-Erling Smørgravalthough the implementation details of the individual access methods 2754ca1ab94SDag-Erling Smørgravvary, it can generally be assumed that a stream returned by one of the 2761a5faa10SDag-Erling Smørgrav.Fn fetchXGetXXX 2771a5faa10SDag-Erling Smørgravor 2784ca1ab94SDag-Erling Smørgrav.Fn fetchGetXXX 2794ca1ab94SDag-Erling Smørgravfunctions is read-only, and that a stream returned by one of the 2804ca1ab94SDag-Erling Smørgrav.Fn fetchPutXXX 2814ca1ab94SDag-Erling Smørgravfunctions is write-only. 2824ca1ab94SDag-Erling Smørgrav.Sh FILE SCHEME 2831a5faa10SDag-Erling Smørgrav.Fn fetchXGetFile , 2844ca1ab94SDag-Erling Smørgrav.Fn fetchGetFile 2854ca1ab94SDag-Erling Smørgravand 2864ca1ab94SDag-Erling Smørgrav.Fn fetchPutFile 2874ca1ab94SDag-Erling Smørgravprovide access to documents which are files in a locally mounted file 288c6ff3a1bSSheldon Hearnsystem. 289c6ff3a1bSSheldon HearnOnly the <document> component of the URL is used. 2904ca1ab94SDag-Erling Smørgrav.Pp 2911a5faa10SDag-Erling Smørgrav.Fn fetchXGetFile 2921a5faa10SDag-Erling Smørgravand 2934ca1ab94SDag-Erling Smørgrav.Fn fetchGetFile 2941a5faa10SDag-Erling Smørgravdo not accept any flags. 2954ca1ab94SDag-Erling Smørgrav.Pp 2964ca1ab94SDag-Erling Smørgrav.Fn fetchPutFile 2974ca1ab94SDag-Erling Smørgravaccepts the 298a7e16a9dSRuslan Ermilov.Ql a 299c6ff3a1bSSheldon Hearn(append to file) flag. 300c6ff3a1bSSheldon HearnIf that flag is specified, the data written to 3014ca1ab94SDag-Erling Smørgravthe stream returned by 3024ca1ab94SDag-Erling Smørgrav.Fn fetchPutFile 3034ca1ab94SDag-Erling Smørgravwill be appended to the previous contents of the file, instead of 3044ca1ab94SDag-Erling Smørgravreplacing them. 3054ca1ab94SDag-Erling Smørgrav.Sh FTP SCHEME 3061a5faa10SDag-Erling Smørgrav.Fn fetchXGetFTP , 3074ca1ab94SDag-Erling Smørgrav.Fn fetchGetFTP 3084ca1ab94SDag-Erling Smørgravand 3094ca1ab94SDag-Erling Smørgrav.Fn fetchPutFTP 3104ca1ab94SDag-Erling Smørgravimplement the FTP protocol as described in RFC959. 3114ca1ab94SDag-Erling Smørgrav.Pp 3124ca1ab94SDag-Erling SmørgravIf the 313a7e16a9dSRuslan Ermilov.Ql p 3144ca1ab94SDag-Erling Smørgrav(passive) flag is specified, a passive (rather than active) connection 3154ca1ab94SDag-Erling Smørgravwill be attempted. 3164ca1ab94SDag-Erling Smørgrav.Pp 317f5f109a0SDag-Erling SmørgravIf the 318a7e16a9dSRuslan Ermilov.Ql l 319d5f175ceSDag-Erling Smørgrav(low) flag is specified, data sockets will be allocated in the low (or 320d5c24aa8SBill Fennerdefault) port range instead of the high port range (see 321f5f109a0SDag-Erling Smørgrav.Xr ip 4 ) . 322f5f109a0SDag-Erling Smørgrav.Pp 323f5f109a0SDag-Erling SmørgravIf the 324a7e16a9dSRuslan Ermilov.Ql d 325f5f109a0SDag-Erling Smørgrav(direct) flag is specified, 3261a5faa10SDag-Erling Smørgrav.Fn fetchXGetFTP , 327f5f109a0SDag-Erling Smørgrav.Fn fetchGetFTP 328f5f109a0SDag-Erling Smørgravand 329f5f109a0SDag-Erling Smørgrav.Fn fetchPutFTP 330f5f109a0SDag-Erling Smørgravwill use a direct connection even if a proxy server is defined. 331f5f109a0SDag-Erling Smørgrav.Pp 3324ca1ab94SDag-Erling SmørgravIf no user name or password is given, the 3334ca1ab94SDag-Erling Smørgrav.Nm fetch 334c86c6f74SDag-Erling Smørgravlibrary will attempt an anonymous login, with user name "anonymous" 335c86c6f74SDag-Erling Smørgravand password "anonymous@<hostname>". 3364ca1ab94SDag-Erling Smørgrav.Sh HTTP SCHEME 3374ca1ab94SDag-Erling SmørgravThe 3381a5faa10SDag-Erling Smørgrav.Fn fetchXGetHTTP , 3394ca1ab94SDag-Erling Smørgrav.Fn fetchGetHTTP 3404ca1ab94SDag-Erling Smørgravand 3414ca1ab94SDag-Erling Smørgrav.Fn fetchPutHTTP 342c6ff3a1bSSheldon Hearnfunctions implement the HTTP/1.1 protocol. 343c6ff3a1bSSheldon HearnWith a little luck, there's 34406b533d3SDag-Erling Smørgraveven a chance that they comply with RFC2616 and RFC2617. 3454ca1ab94SDag-Erling Smørgrav.Pp 346f5f109a0SDag-Erling SmørgravIf the 347a7e16a9dSRuslan Ermilov.Ql d 348f5f109a0SDag-Erling Smørgrav(direct) flag is specified, 3491a5faa10SDag-Erling Smørgrav.Fn fetchXGetHTTP , 350f5f109a0SDag-Erling Smørgrav.Fn fetchGetHTTP 351f5f109a0SDag-Erling Smørgravand 352f5f109a0SDag-Erling Smørgrav.Fn fetchPutHTTP 353f5f109a0SDag-Erling Smørgravwill use a direct connection even if a proxy server is defined. 354f5f109a0SDag-Erling Smørgrav.Pp 3554ca1ab94SDag-Erling SmørgravSince there seems to be no good way of implementing the HTTP PUT 3564ca1ab94SDag-Erling Smørgravmethod in a manner consistent with the rest of the 3574ca1ab94SDag-Erling Smørgrav.Nm fetch 3584ca1ab94SDag-Erling Smørgravlibrary, 3594ca1ab94SDag-Erling Smørgrav.Fn fetchPutHTTP 3604ca1ab94SDag-Erling Smørgravis currently unimplemented. 36106b533d3SDag-Erling Smørgrav.Sh AUTHENTICATION 36206b533d3SDag-Erling SmørgravApart from setting the appropriate environment variables and 36306b533d3SDag-Erling Smørgravspecifying the user name and password in the URL or the 364a7e16a9dSRuslan Ermilov.Vt struct url , 36506b533d3SDag-Erling Smørgravthe calling program has the option of defining an authentication 36606b533d3SDag-Erling Smørgravfunction with the following prototype: 36706b533d3SDag-Erling Smørgrav.Pp 36806b533d3SDag-Erling Smørgrav.Ft int 36906b533d3SDag-Erling Smørgrav.Fn myAuthMethod "struct url *u" 37006b533d3SDag-Erling Smørgrav.Pp 37106b533d3SDag-Erling SmørgravThe callback function should fill in the 37206b533d3SDag-Erling Smørgrav.Fa user 37306b533d3SDag-Erling Smørgravand 37406b533d3SDag-Erling Smørgrav.Fa pwd 37506b533d3SDag-Erling Smørgravfields in the provided 376a7e16a9dSRuslan Ermilov.Vt struct url 37706b533d3SDag-Erling Smørgravand return 0 on success, or any other value to indicate failure. 37806b533d3SDag-Erling Smørgrav.Pp 37906b533d3SDag-Erling SmørgravTo register the authentication callback, simply set 380a7e16a9dSRuslan Ermilov.Va fetchAuthMethod 38106b533d3SDag-Erling Smørgravto point at it. 38206b533d3SDag-Erling SmørgravThe callback will be used whenever a site requires authentication and 38306b533d3SDag-Erling Smørgravthe appropriate environment variables aren't set. 38406b533d3SDag-Erling Smørgrav.Pp 38506b533d3SDag-Erling SmørgravThis interface is experimental and may be subject to change. 3864ca1ab94SDag-Erling Smørgrav.Sh RETURN VALUES 3874ca1ab94SDag-Erling Smørgrav.Fn fetchParseURL 3884ca1ab94SDag-Erling Smørgravreturns a pointer to a 389a7e16a9dSRuslan Ermilov.Vt struct url 390c6ff3a1bSSheldon Hearncontaining the individual components of the URL. 391c6ff3a1bSSheldon HearnIf it is 3924ca1ab94SDag-Erling Smørgravunable to allocate memory, or the URL is syntactically incorrect, 3934ca1ab94SDag-Erling Smørgrav.Fn fetchParseURL 3944ca1ab94SDag-Erling Smørgravreturns a NULL pointer. 3954ca1ab94SDag-Erling Smørgrav.Pp 396d8acd8dcSDag-Erling SmørgravThe 397d8acd8dcSDag-Erling Smørgrav.Fn fetchStat 398d8acd8dcSDag-Erling Smørgravfunctions return 0 on success and -1 on failure. 399d8acd8dcSDag-Erling Smørgrav.Pp 4004ca1ab94SDag-Erling SmørgravAll other functions return a stream pointer which may be used to 401d8acd8dcSDag-Erling Smørgravaccess the requested document, or NULL if an error occurred. 402d8acd8dcSDag-Erling Smørgrav.Pp 403ba101983SDag-Erling SmørgravThe following error codes are defined in 404ba101983SDag-Erling Smørgrav.Aq Pa fetch.h : 40515efcd39SAlexey Zelkin.Bl -tag -width 18n 406d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_ABORT 407d8acd8dcSDag-Erling SmørgravOperation aborted 408d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_AUTH 409d8acd8dcSDag-Erling SmørgravAuthentication failed 410d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_DOWN 411d8acd8dcSDag-Erling SmørgravService unavailable 412d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_EXISTS 413d8acd8dcSDag-Erling SmørgravFile exists 414d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_FULL 415d8acd8dcSDag-Erling SmørgravFile system full 416d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_INFO 417d8acd8dcSDag-Erling SmørgravInformational response 418d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_MEMORY 419d8acd8dcSDag-Erling SmørgravInsufficient memory 420d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_MOVED 421d8acd8dcSDag-Erling SmørgravFile has moved 422d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_NETWORK 423d8acd8dcSDag-Erling SmørgravNetwork error 424d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_OK 425d8acd8dcSDag-Erling SmørgravNo error 426d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_PROTO 427d8acd8dcSDag-Erling SmørgravProtocol error 428d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_RESOLV 429d8acd8dcSDag-Erling SmørgravResolver error 430d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_SERVER 431d8acd8dcSDag-Erling SmørgravServer error 432d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_TEMP 433d8acd8dcSDag-Erling SmørgravTemporary error 434d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_TIMEOUT 435d8acd8dcSDag-Erling SmørgravOperation timed out 436d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_UNAVAIL 437d8acd8dcSDag-Erling SmørgravFile is not available 438d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_UNKNOWN 439d8acd8dcSDag-Erling SmørgravUnknown error 440d8acd8dcSDag-Erling Smørgrav.It Bq Er FETCH_URL 441d8acd8dcSDag-Erling SmørgravInvalid URL 442d8acd8dcSDag-Erling Smørgrav.El 443d8acd8dcSDag-Erling Smørgrav.Pp 444d8acd8dcSDag-Erling SmørgravThe accompanying error message includes a protocol-specific error code 445d8acd8dcSDag-Erling Smørgravand message, e.g. "File is not available (404 Not Found)" 4464ca1ab94SDag-Erling Smørgrav.Sh ENVIRONMENT 447c42cb9d9SDag-Erling Smørgrav.Bl -tag -width FETCH_BIND_ADDRESS 448c42cb9d9SDag-Erling Smørgrav.It Ev FETCH_BIND_ADDRESS 449c42cb9d9SDag-Erling SmørgravSpecifies a hostname or IP address to which sockets used for outgoing 450c42cb9d9SDag-Erling Smørgravconnections will be bound. 451659e0d5eSDag-Erling Smørgrav.It Ev FTP_LOGIN 452659e0d5eSDag-Erling SmørgravDefault FTP login if none was provided in the URL. 45391c51046SDag-Erling Smørgrav.It Ev FTP_PASSIVE_MODE 4546c81eb52SDag-Erling SmørgravIf set to anything but 4556c81eb52SDag-Erling Smørgrav.Ql no , 4566c81eb52SDag-Erling Smørgravforces the FTP code to use passive mode. 45791c51046SDag-Erling Smørgrav.It Ev FTP_PASSWORD 45891c51046SDag-Erling SmørgravDefault FTP password if the remote server requests one and none was 45991c51046SDag-Erling Smørgravprovided in the URL. 460bc2a5e68SDag-Erling Smørgrav.It Ev FTP_PROXY 4611df2031cSDag-Erling SmørgravURL of the proxy to use for FTP requests. 4621df2031cSDag-Erling SmørgravThe document part is ignored. 4631df2031cSDag-Erling SmørgravFTP and HTTP proxies are supported; if no scheme is specified, FTP is 4641df2031cSDag-Erling Smørgravassumed. 4651df2031cSDag-Erling SmørgravIf the proxy is an FTP proxy, 466e0a9ca38SDag-Erling Smørgrav.Nm libfetch 467e0a9ca38SDag-Erling Smørgravwill send 468e0a9ca38SDag-Erling Smørgrav.Ql user@host 469e0a9ca38SDag-Erling Smørgravas user name to the proxy, where 470e0a9ca38SDag-Erling Smørgrav.Ql user 471e0a9ca38SDag-Erling Smørgravis the real user name, and 472e0a9ca38SDag-Erling Smørgrav.Ql host 473e0a9ca38SDag-Erling Smørgravis the name of the FTP server. 47489d755e1SDag-Erling Smørgrav.Pp 4752e83f638SDag-Erling SmørgravIf this variable is set to an empty string, no proxy will be used for 4762e83f638SDag-Erling SmørgravFTP requests, even if the 4772e83f638SDag-Erling Smørgrav.Ev HTTP_PROXY 4782e83f638SDag-Erling Smørgravvariable is set. 4794cee73c8SDag-Erling Smørgrav.It Ev ftp_proxy 4804cee73c8SDag-Erling SmørgravSame as 4814cee73c8SDag-Erling Smørgrav.Ev FTP_PROXY , 4824cee73c8SDag-Erling Smørgravfor compatibility. 48398f5573fSDag-Erling Smørgrav.It Ev HTTP_AUTH 48489d755e1SDag-Erling SmørgravSpecifies HTTP authorization parameters as a colon-separated list of 48589d755e1SDag-Erling Smørgravitems. 48698f5573fSDag-Erling SmørgravThe first and second item are the authorization scheme and realm 48798f5573fSDag-Erling Smørgravrespectively; further items are scheme-dependent. 48898f5573fSDag-Erling SmørgravCurrently, only basic authorization is supported. 48989d755e1SDag-Erling Smørgrav.Pp 49098f5573fSDag-Erling SmørgravBasic authorization requires two parameters: the user name and 49198f5573fSDag-Erling Smørgravpassword, in that order. 49289d755e1SDag-Erling Smørgrav.Pp 49389d755e1SDag-Erling SmørgravThis variable is only used if the server requires authorization and 49489d755e1SDag-Erling Smørgravno user name or password was specified in the URL. 495bc2a5e68SDag-Erling Smørgrav.It Ev HTTP_PROXY 4961df2031cSDag-Erling SmørgravURL of the proxy to use for HTTP requests. 4971df2031cSDag-Erling SmørgravThe document part is ignored. 4981df2031cSDag-Erling SmørgravOnly HTTP proxies are supported for HTTP requests. 499bc2a5e68SDag-Erling SmørgravIf no port number is specified, the default is 3128. 50089d755e1SDag-Erling Smørgrav.Pp 5011df2031cSDag-Erling SmørgravNote that this proxy will also be used for FTP documents, unless the 502e0a9ca38SDag-Erling Smørgrav.Ev FTP_PROXY 503e0a9ca38SDag-Erling Smørgravvariable is set. 5044cee73c8SDag-Erling Smørgrav.It Ev http_proxy 5054cee73c8SDag-Erling SmørgravSame as 5064cee73c8SDag-Erling Smørgrav.Ev HTTP_PROXY , 5074cee73c8SDag-Erling Smørgravfor compatibility. 508bc2a5e68SDag-Erling Smørgrav.It Ev HTTP_PROXY_AUTH 50998f5573fSDag-Erling SmørgravSpecifies authorization parameters for the HTTP proxy in the same 510e0a9ca38SDag-Erling Smørgravformat as the 511e0a9ca38SDag-Erling Smørgrav.Ev HTTP_AUTH 512e0a9ca38SDag-Erling Smørgravvariable. 51389d755e1SDag-Erling Smørgrav.Pp 5141df2031cSDag-Erling SmørgravThis variable is used if and only if connected to an HTTP proxy, and 5151df2031cSDag-Erling Smørgravis ignored if a user and/or a password were specified in the proxy 5161df2031cSDag-Erling SmørgravURL. 517d5216a4fSDag-Erling Smørgrav.It Ev HTTP_REFERER 51857bd0fc6SJens SchweikhardtSpecifies the referrer URL to use for HTTP requests. 519d5216a4fSDag-Erling SmørgravIf set to 520d5216a4fSDag-Erling Smørgrav.Dq auto , 52157bd0fc6SJens Schweikhardtthe document URL will be used as referrer URL. 5226a0cf64bSDag-Erling Smørgrav.It Ev HTTP_USER_AGENT 5236a0cf64bSDag-Erling SmørgravSpecifies the User-Agent string to use for HTTP requests. 5246a0cf64bSDag-Erling SmørgravThis can be useful when working with HTTP origin or proxy servers that 525a7e16a9dSRuslan Ermilovdifferentiate between user agents. 5260ab4a51eSDag-Erling Smørgrav.It Ev NETRC 5270ab4a51eSDag-Erling SmørgravSpecifies a file to use instead of 5280ab4a51eSDag-Erling Smørgrav.Pa ~/.netrc 5290ab4a51eSDag-Erling Smørgravto look up login names and passwords for FTP sites. 5300ab4a51eSDag-Erling SmørgravSee 5310ab4a51eSDag-Erling Smørgrav.Xr ftp 1 5320ab4a51eSDag-Erling Smørgravfor a description of the file format. 5330ab4a51eSDag-Erling SmørgravThis feature is experimental. 534bc2a5e68SDag-Erling Smørgrav.El 5354ca1ab94SDag-Erling Smørgrav.Sh SEE ALSO 5364ca1ab94SDag-Erling Smørgrav.Xr fetch 1 , 537f5f109a0SDag-Erling Smørgrav.Xr ftpio 3 , 538c86c6f74SDag-Erling Smørgrav.Xr ip 4 539c86c6f74SDag-Erling Smørgrav.Rs 540c86c6f74SDag-Erling Smørgrav.%A J. Postel 541c86c6f74SDag-Erling Smørgrav.%A J. K. Reynolds 542c86c6f74SDag-Erling Smørgrav.%D October 1985 543c86c6f74SDag-Erling Smørgrav.%B File Transfer Protocol 544c86c6f74SDag-Erling Smørgrav.%O RFC959 545c86c6f74SDag-Erling Smørgrav.Re 546c86c6f74SDag-Erling Smørgrav.Rs 547c86c6f74SDag-Erling Smørgrav.%A P. Deutsch 548c86c6f74SDag-Erling Smørgrav.%A A. Emtage 549c86c6f74SDag-Erling Smørgrav.%A A. Marine. 550c86c6f74SDag-Erling Smørgrav.%D May 1994 551c86c6f74SDag-Erling Smørgrav.%T How to Use Anonymous FTP 552c86c6f74SDag-Erling Smørgrav.%O RFC1635 55398849115SRuslan Ermilov.Re 5544ca1ab94SDag-Erling Smørgrav.Rs 5550f5fcaa3SSheldon Hearn.%A T. Berners-Lee 5560f5fcaa3SSheldon Hearn.%A L. Masinter 5570f5fcaa3SSheldon Hearn.%A M. McCahill 5584ca1ab94SDag-Erling Smørgrav.%D December 1994 5594ca1ab94SDag-Erling Smørgrav.%T Uniform Resource Locators (URL) 5604ca1ab94SDag-Erling Smørgrav.%O RFC1738 5614ca1ab94SDag-Erling Smørgrav.Re 5624ca1ab94SDag-Erling Smørgrav.Rs 5630f5fcaa3SSheldon Hearn.%A R. Fielding 5640f5fcaa3SSheldon Hearn.%A J. Gettys 5650f5fcaa3SSheldon Hearn.%A J. Mogul 5660f5fcaa3SSheldon Hearn.%A H. Frystyk 56706b533d3SDag-Erling Smørgrav.%A L. Masinter 56806b533d3SDag-Erling Smørgrav.%A P. Leach 5690f5fcaa3SSheldon Hearn.%A T. Berners-Lee 570d5c24aa8SBill Fenner.%D January 1999 5714ca1ab94SDag-Erling Smørgrav.%B Hypertext Transfer Protocol -- HTTP/1.1 57206b533d3SDag-Erling Smørgrav.%O RFC2616 57306b533d3SDag-Erling Smørgrav.Re 57406b533d3SDag-Erling Smørgrav.Rs 57506b533d3SDag-Erling Smørgrav.%A J. Franks 57606b533d3SDag-Erling Smørgrav.%A P. Hallam-Baker 57706b533d3SDag-Erling Smørgrav.%A J. Hostetler 57806b533d3SDag-Erling Smørgrav.%A S. Lawrence 57906b533d3SDag-Erling Smørgrav.%A P. Leach 58006b533d3SDag-Erling Smørgrav.%A A. Luotonen 58106b533d3SDag-Erling Smørgrav.%A L. Stewart 58206b533d3SDag-Erling Smørgrav.%D June 1999 58306b533d3SDag-Erling Smørgrav.%B HTTP Authentication: Basic and Digest Access Authentication 58406b533d3SDag-Erling Smørgrav.%O RFC2617 5854ca1ab94SDag-Erling Smørgrav.Re 5864ca1ab94SDag-Erling Smørgrav.Sh HISTORY 5874ca1ab94SDag-Erling SmørgravThe 5884ca1ab94SDag-Erling Smørgrav.Nm fetch 5894ca1ab94SDag-Erling Smørgravlibrary first appeared in 5904ca1ab94SDag-Erling Smørgrav.Fx 3.0 . 5914ca1ab94SDag-Erling Smørgrav.Sh AUTHORS 592725ab628SRuslan Ermilov.An -nosplit 5934ca1ab94SDag-Erling SmørgravThe 5944ca1ab94SDag-Erling Smørgrav.Nm fetch 5954ca1ab94SDag-Erling Smørgravlibrary was mostly written by 596b82f5db0SRuslan Ermilov.An Dag-Erling Co\(:idan Sm\(/orgrav Aq des@FreeBSD.org 5974ca1ab94SDag-Erling Smørgravwith numerous suggestions from 598d8acd8dcSDag-Erling Smørgrav.An Jordan K. Hubbard Aq jkh@FreeBSD.org , 599d8acd8dcSDag-Erling Smørgrav.An Eugene Skepner Aq eu@qub.com 600b5c508fbSRuslan Ermilovand other 601b5c508fbSRuslan Ermilov.Fx 602b5c508fbSRuslan Ermilovdevelopers. 603d8acd8dcSDag-Erling SmørgravIt replaces the older 6044ca1ab94SDag-Erling Smørgrav.Nm ftpio 605d8acd8dcSDag-Erling Smørgravlibrary written by 606d8acd8dcSDag-Erling Smørgrav.An Poul-Henning Kamp Aq pkh@FreeBSD.org 607d8acd8dcSDag-Erling Smørgravand 6084ca1ab94SDag-Erling Smørgrav.An Jordan K. Hubbard Aq jkh@FreeBSD.org . 6094ca1ab94SDag-Erling Smørgrav.Pp 6104ca1ab94SDag-Erling SmørgravThis manual page was written by 611725ab628SRuslan Ermilov.An Dag-Erling Co\(:idan Sm\(/orgrav Aq des@FreeBSD.org . 6124ca1ab94SDag-Erling Smørgrav.Sh BUGS 613c6ff3a1bSSheldon HearnSome parts of the library are not yet implemented. 614c6ff3a1bSSheldon HearnThe most notable 615d8acd8dcSDag-Erling Smørgravexamples of this are 616d8acd8dcSDag-Erling Smørgrav.Fn fetchPutHTTP , 617ce71b736SDag-Erling Smørgrav.Fn fetchListHTTP , 61815efcd39SAlexey Zelkin.Fn fetchListFTP 619d8acd8dcSDag-Erling Smørgravand FTP proxy support. 620d8acd8dcSDag-Erling Smørgrav.Pp 621db5f8cebSDag-Erling SmørgravThere's no way to select a proxy at run-time other than setting the 622db5f8cebSDag-Erling Smørgrav.Ev HTTP_PROXY 623db5f8cebSDag-Erling Smørgravor 624db5f8cebSDag-Erling Smørgrav.Ev FTP_PROXY 625c6ff3a1bSSheldon Hearnenvironment variables as appropriate. 62698f5573fSDag-Erling Smørgrav.Pp 627842a95ccSDag-Erling Smørgrav.Nm libfetch 62898f5573fSDag-Erling Smørgravdoes not understand or obey 305 (Use Proxy) replies. 62998f5573fSDag-Erling Smørgrav.Pp 630842a95ccSDag-Erling SmørgravError numbers are unique only within a certain context; the error 631842a95ccSDag-Erling Smørgravcodes used for FTP and HTTP overlap, as do those used for resolver and 632c6ff3a1bSSheldon Hearnsystem errors. 633c6ff3a1bSSheldon HearnFor instance, error code 202 means "Command not 634842a95ccSDag-Erling Smørgravimplemented, superfluous at this site" in an FTP context and 635842a95ccSDag-Erling Smørgrav"Accepted" in an HTTP context. 636842a95ccSDag-Erling Smørgrav.Pp 637f5f109a0SDag-Erling Smørgrav.Fn fetchStatFTP 638f5f109a0SDag-Erling Smørgravdoes not check that the result of an MDTM command is a valid date. 639f5f109a0SDag-Erling Smørgrav.Pp 6401a5faa10SDag-Erling SmørgravThe man page is incomplete, poorly written and produces badly 6411a5faa10SDag-Erling Smørgravformatted text. 642db5f8cebSDag-Erling Smørgrav.Pp 643ba101983SDag-Erling SmørgravThe error reporting mechanism is unsatisfactory. 644ba101983SDag-Erling Smørgrav.Pp 645ba101983SDag-Erling SmørgravSome parts of the code are not fully reentrant. 646