[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Behaviour of tmpnam

From: Dirk Herrmann
Subject: Re: Behaviour of tmpnam
Date: Fri, 9 Feb 2001 12:13:40 +0100 (MET)

On Sun, 4 Feb 2001, Alexander Klimov wrote:

> It is strange, because documentation said: `This function is implemented
> with the `tmpnam' function in the system libraries', and documentation of
> tmpnam said (tmpnam(3S)): 
>      tempnam() allows the user to control the choice of a  direc-
>      tory.   The argument dir points to the name of the directory
>      in which the file is to be  created.   If  dir  is  NULL  or
>      points  to  a  string  that is not a name for an appropriate
>      directory,  the  path-prefix  defined  as  P_tmpdir  in  the
>      <stdio.h> header is used.  If that directory is not accessi-
>      ble, /tmp will be  used  as  a  last  resort.   This  entire
>      sequence  can be up-staged by providing an environment vari-
>      able TMPDIR in the user's environment, whose  value  is  the
>      name of the desired temporary-file directory.

Yes, but the implementation of guile's tmpnam uses 'tmpnam', not
'tempnam'.  According to my manual page, tmpnam always uses the definition
from <stdio.h>, while tempnam does what you want it to do.

It would certainly be possible to also provide tempnam on the scheme
level, and fix the corresponding test to use that one.  However, I am not
sure if it is the right thing, and therefore would prefer if someone else
could take a look at this issue.

Best regards,
Dirk Herrmann

reply via email to

[Prev in Thread] Current Thread [Next in Thread]