Computer Science


TMPFILE(3)          Linux Programmer's Manual          TMPFILE(3)

NAME
       tmpfile - create a temporary file

SYNOPSIS
       #include <stdio.h>

       FILE *tmpfile (void);

DESCRIPTION
       The  tmpfile() function generates a unique temporary file-
       name using the path prefix P_tmpdir defined in  <stdio.h>.
       The  temporary  file  is  then opened in binary read/write
       (w+b) mode.  The file will be automatically  deleted  when
       it is closed or the program terminates.

RETURN VALUE
       The  tmpfile()  function  returns  a stream descriptor, or
       NULL if a unique  filename  cannot  be  generated  or  the
       unique file cannot be opened.

ERRORS
       EACCES Search  permission  denied  for directory in file's
              path prefix.

       EEXIST Unable to generate a unique filename.

       EMFILE Too many file descriptors in use by process.

       ENFILE Too many files open in system.

       EROFS  Read-only filesystem.

CONFORMING TO
       SVID 3, POSIX, BSD 4.3, ISO 9899

SEE ALSO
       mktemp(3), mkstemp(3), tmpnam(3), tempnam(3)

GNU                       April 3, 1993                         1

Back to the index


Apply now!


Handbook

Postgraduate study options

Computer Science Blog



Please give us your feedback or ask us a question

This message is...


My feedback or question is...


My email address is...

(Only if you need a reply)

A to Z Directory | Site map | Accessibility | Copyright | Privacy | Disclaimer | Feedback on this page