*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> mktemp (1)              
Title
Content
Arch
Section
 

Contents


 mktemp(1)                                                         mktemp(1)




 NAME    [Toc]    [Back]
      mktemp - make a name for a temporary file

 SYNOPSIS    [Toc]    [Back]
      mktemp [-c] [-d directory_name] [-p prefix]

 DESCRIPTION    [Toc]    [Back]
      mktemp makes a name that is suitable for use as the pathname of a
      temporary file, and writes that name to the standard output.  The name
      is chosen such that it does not duplicate the name of an existing
      file.  If the -c option is specified, a zero-length file is created
      with the generated name.

      The name generated by mktemp is the concatenation of a directory name,
      a slash (/), the value of the LOGNAME environment variable truncated
      to {NAME_MAX} - 6 characters, and the process ID of the invoking
      process.

      The directory name is chosen as follows:

           1.   If the -d option is specified, directory_name is used.

           2.   Otherwise, if the TMPDIR environment variable is set and a
                string that would yield a unique name can be obtained by
                using the value of that variable as a directory name, this
                value is used.

           3.   Otherwise, if a string that would yield a unique name can be
                obtained using /tmp as the directory, /tmp is used.

           4.   Otherwise, . (current directory) is used.

      If the -p option is specified, prefix is used instead of the value of
      the LOGNAME environment variable for name generation.

 RETURN VALUE    [Toc]    [Back]
      mktemp returns zero on successful completion and non-zero if syntax,
      file access, or file creation errors were encountered or a unique
      pathname could not be generated.

 SEE ALSO    [Toc]    [Back]
      mktemp(3C), umask(1).


 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003
[ Back ]
      
      
 Similar pages
Name OS Title
mktemp FreeBSD make temporary file name (unique)
mkstemps FreeBSD make temporary file name (unique)
mkstemp FreeBSD make temporary file name (unique)
mkdtemp FreeBSD make temporary file name (unique)
mkstemp OpenBSD make temporary file name (unique)
mktemp Linux make a unique temporary file name
mkstemps OpenBSD make temporary file name (unique)
mkdtemp OpenBSD make temporary file name (unique)
mktemp FreeBSD make temporary file name (unique)
mktemp OpenBSD make temporary file name (unique)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service