Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2001 10:46:14 -0600 (CST)
From:      Antoine Beaupré <antoine@usw4.freebsd.org>
To:        libh@FreeBSD.org
Subject:   cvs commit: libh/lib/file Fetch.cc Fetch.cd.cc File.cc libh/include/file Fetch.hh File.hh
Message-ID:  <200112051646.fB5GkE145835@usw4.freebsd.org>

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

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




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