diff --git a/collects/net/ftp.rkt b/collects/net/ftp.rkt index 431f469545..8a85a5e4f9 100644 --- a/collects/net/ftp.rkt +++ b/collects/net/ftp.rkt @@ -202,8 +202,8 @@ ;; Save the file under the name tmp.file, rename it once download is ;; complete this assures we don't over write any existing file without ;; having a good file down - (let* ([tmpfile "file.tmp"] - [new-file (open-output-file tmpfile #:exists 'replace)] + (let* ([tmpfile (make-temporary-file "~a.download" #f folder)] + [new-file (open-output-file tmpfile #:exists 'truncate)] [tcp-data (establish-data-connection ftp-ports 'in)]) (transfer-data ftp-ports 'download tcp-data new-file filename progress-proc) diff --git a/collects/net/scribblings/ftp.scrbl b/collects/net/scribblings/ftp.scrbl index cf68e0d86b..e7c317396c 100644 --- a/collects/net/scribblings/ftp.scrbl +++ b/collects/net/scribblings/ftp.scrbl @@ -91,7 +91,7 @@ Downloads @racket[file] from the server's current directory and puts it in @racket[local-dir] using the same name. If the file already exists in the local directory, it is replaced, but only after the transfer succeeds (i.e., the file is first downloaded to a temporary -file, then moved into place on success). +file in @racket[local-dir], then moved into place on success). If @racket[progress-proc] is not @racket[#f], then it is called with a function @racket[_get-count] that returns two values: the number of bytes