From owner-freebsd-libh Wed Dec 5 8:46:20 2001 Delivered-To: freebsd-libh@freebsd.org Received: from usw4.freebsd.org (usw4.freebsd.org [209.180.6.228]) by hub.freebsd.org (Postfix) with ESMTP id 8D89B37B417 for ; Wed, 5 Dec 2001 08:46:15 -0800 (PST) Received: (from antoine@localhost) by usw4.freebsd.org (8.11.6/8.11.6) id fB5GkE145835 for libh@FreeBSD.org; Wed, 5 Dec 2001 10:46:14 -0600 (CST) (envelope-from antoine) Message-Id: <200112051646.fB5GkE145835@usw4.freebsd.org> From: Antoine Beaupré Date: Wed, 5 Dec 2001 10:46:14 -0600 (CST) To: libh@FreeBSD.org Subject: cvs commit: libh/lib/file Fetch.cc Fetch.cd.cc File.cc libh/include/file Fetch.hh File.hh Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG antoine 2001/12/05 10:46:14 CST Modified files: lib/file Fetch.cc Fetch.cd.cc File.cc include/file Fetch.hh File.hh Log: As threatened on -libh, hack File to remove the mktemp() call. o File::localName() doesn't use mktemp() anymore. It now just sets the localName from the url appropriatly if not already set. It will not create a temp file. Use File::create_tmp_file() for that instead. localName() now returns an empty file name if the file is remote and no local copy has been created yet, as is documented in the source. o Fetch::download doesn't require a local filename anymore, it generates a temporary file securly and returns its path. It should, however, be allowed to take a filename argument to allow download to a given (instead of temporary) file. This does make the code a bit more complex though, since all code that used to call localName() must condition on wether or not the local file has been created, and conditionally create that file. localName() and File, in general, haven't been properly designed, IMHO. The fact that localName() initializes mLocalName and created a file is counter-intuitive. mUrl should be accessible only through a setUrl interface and that should set mLocalName accordingly. Or simply have no mLocalName field and only a localName() method. The local file should then be created when asked/needed. Not when accessing its path. This is the new behavior. The behavior of File and Fetch shouldn't be changed at all apart from these modifications. Approved by: 2 days silence on -libh Revision Changes Path 1.6 +23 -7 libh/lib/file/Fetch.cc 1.6 +3 -2 libh/lib/file/Fetch.cd.cc 1.9 +30 -11 libh/lib/file/File.cc 1.5 +2 -2 libh/include/file/Fetch.hh 1.6 +4 -1 libh/include/file/File.hh To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message