Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Dec 2001 15:14:30 -0500
From:      The Anarcat <anarcat@anarcat.dyndns.org>
To:        Libh <freebsd-libh@freebsd.org>
Subject:   should File always download local copies?
Message-ID:  <20011204201430.GB17827@shall.anarcat.dyndns.org>

next in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011204201430.GB17827>