Re: [Boost-bugs] [Boost C++ Libraries] #2324: Use of tmpnam may produce spurious test results

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2324: Use of tmpnam may produce spurious test results
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-08 02:06:01


#2324: Use of tmpnam may produce spurious test results
---------------------------+------------------------------------------------
  Reporter: dave | Owner: ramey
      Type: Bugs | Status: reopened
 Milestone: Boost 1.37.0 | Component: serialization
   Version: Boost 1.36.0 | Severity: Problem
Resolution: | Keywords:
---------------------------+------------------------------------------------

Comment (by mikhailberis):

 Replying to [comment:12 ramey]:
> I ran this with bjam and things seemed to work fine.
>

 Cool.

> I do have a few questions however.
>
> a) I didn't find any documentation in the boost/filesystem regarding
 unique_path. This concerned me somewhat but not all that much.
>

 http://www.boost.org/doc/libs/1_45_0/libs/filesystem/v3/doc/reference.html#unique_path

 This is in Boost.Filesystem V3.

> b) I couldn't figure out in which directory the temporary files are
 created. For the windows platform, there is special code to be sure that
 they are created in the $TMP or $TEMP directory. But, for *nix, I relied
 upon the fact that tmpnam creates it's files in these temporary
 directories. It seems that this fix looses that that. So does this
 guarantee that these files are created in the $TMP directory and if not,
 can it be modified to guarantee this?
>

 On Unix, the path in the patch would just create the file where the binary
 was being run. I was thinking since this was really a temporary file, that
 the tests would actually delete the file once they're done.

 The answer would be yes, that the pattern can be modified to create a path
 which actually uses the $TMP environment variable as part of the pattern,
 or have it hard-coded to be '/tmp/serialization-%%%%%%%%%%%%%%%%'.

 I'll check to see whether I can find a portable UNIX way of at least
 getting the correct temporary directory path.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2324#comment:13>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC