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

  man pages->IRIX man pages -> tmpfile (3s)              
Title
Content
Arch
Section
 

Contents


TMPFILE(3S)							   TMPFILE(3S)


NAME    [Toc]    [Back]

     tmpfile - create a	temporary file

SYNOPSIS    [Toc]    [Back]

     #include <stdio.h>

     FILE *tmpfile (void);

DESCRIPTION    [Toc]    [Back]

     tmpfile creates a temporary file, and returns a corresponding FILE
     pointer.  The file	is created on the temporary directory indicated	by the
     string P_tmpdir in	<stdio.h>.  However, if	the variable TMPDIR is
     provided in the user's environment, the variable's	value is the name of
     the desired temporary-file	directory.  If the directory specified by the
     variable TMPDIR is	not accessible,	the directory specified	by the string
     P_tmpdir in <stdio.h> will	be used.

     If	the file cannot	be opened, a NULL pointer is returned.	Upon return
     from tmpfile, you may print an error message using	perror(3C), to
     determine the reason for the failure.  A success call to tmpfile will
     create a temporary	file just long enough to obtain	the FILE pointer, then
     delete the	file with unlink(2), and finally return	the FILE pointer to
     the calling process.  Thus, the only means	of accessing the temporary
     file is though the	FILE pointer.  The file	is opened for update ("w+").

     Although the name of the temporary	file is	generated similarly to those
     produced by tmpnam(3S), tmpfile uses its own algorithm to generate
     filenames similar to, but unique from, those generated by tmpnam.	This
     allocates the entire space	of tmpnam-generated names to applications
     code. (See	tmpnam(3S) for more information.)

ENVIRONMENT VARIABLES    [Toc]    [Back]

     TMPDIR
	  If the environment variable TMPDIR is	provided, it is	used as	the
	  desired temporary-file directory. The	support	for the	TMPDIR
	  environment variable is introduced in	IRIX 6.5.9.

SEE ALSO    [Toc]    [Back]

      
      
     creat(2), unlink(2), fopen(3S), mktemp(3C), perror(3C), stdio(3S),
     tmpnam(3S).


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
tmpnam IRIX create a name for a temporary file
tempnam Linux create a name for a temporary file
tmpnam Linux create a name for a temporary file
mkstemp Linux create a unique temporary file
tempfile Linux create a temporary file in a safe manner
tempnam Tru64 Construct the name for a temporary file
tmpnam FreeBSD temporary file routines
tempnam FreeBSD temporary file routines
tempnam OpenBSD temporary file routines
tmpfile FreeBSD temporary file routines
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service