From owner-freebsd-libh Tue Dec 4 12:13: 0 2001 Delivered-To: freebsd-libh@freebsd.org Received: from tomts17-srv.bellnexxia.net (tomts17.bellnexxia.net [209.226.175.71]) by hub.freebsd.org (Postfix) with ESMTP id 1584637B405 for ; Tue, 4 Dec 2001 12:12:57 -0800 (PST) Received: from khan.anarcat.dyndns.org ([65.94.190.39]) by tomts17-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011204201256.IRJU16532.tomts17-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Tue, 4 Dec 2001 15:12:56 -0500 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 7011E1AE8 for ; Tue, 4 Dec 2001 15:17:31 -0500 (EST) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 406EE20ACD; Tue, 4 Dec 2001 15:14:30 -0500 (EST) Date: Tue, 4 Dec 2001 15:14:30 -0500 From: The Anarcat To: Libh Subject: should File always download local copies? Message-ID: <20011204201430.GB17827@shall.anarcat.dyndns.org> Mail-Followup-To: The Anarcat , Libh Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7ZAtKRhVyVSsbBD2" Content-Disposition: inline User-Agent: Mutt/1.3.23.2i 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 --7ZAtKRhVyVSsbBD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi! File is indeed an odd class. But it works. There is something I am wondering though.... File::open_local() completely downloads the file in a local temporary copy and returns the path to that copy. File::open_for_reading() does the same thing but instead returns a freshly opened FILE descriptor to this file. I wonder what use is that method. I also wonder why it's not simply implemented as: FILE* f = mFile = ::fopen( open_local(remove_local).c_str(), "r" ); At least, if it was giving the opportunity of accessing the *network* file descriptor instead of a local copy, it would be useful, but now it's just bloat. That's why I'm asking to see if it wouldn't be efficient of *not* always having a local copy of a remote file, or at least have that copy not fully downloaded before return control. I think it's bound to be removed. I'll make modifications to the code: reimplementation, and adding a __warn_references a la mktemp() so that ppl will not use it. Actually, I'll could just remove it altogether.... Anyways, File's design has to be re-thought, it seems. I'll think a bit more about this. And I'll commit the mktemp modif bits today. a. --7ZAtKRhVyVSsbBD2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjwNLqUACgkQttcWHAnWiGfqFACeP0bGs4AiEoZL092HLdxOos7z PMEAn0YDtbNWCDurHthzIsyWX0fyA6Vq =Rejb -----END PGP SIGNATURE----- --7ZAtKRhVyVSsbBD2-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message