1Netpbm subroutine library: pLNmie_bttrpmabprmfyislFueub(nr)cotufituoinnncsetiMloainnb(ur3aa)lry: pm_tmpfile() function(3)
2
3
4

NAME

6       pm_tmpfile() - create a temporary unnamed file
7
8

SYNOPSIS

10       #include <netpbm/pm.h>
11
12       FILE *
13       pm_tmpfile(void);
14
15
16

EXAMPLE

18       This  simple  example creates a temporary file, writes "hello world" to
19       it, then reads back and prints those contents.
20
21       #include <netpbm/pm.h>
22
23       FILE * myfileP;
24
25       myfile = pm_tmpfile();
26
27       fprintf(myfile, "hello world\n");
28
29       fseek(myfileP, 0, SEEK_SET);
30
31       fread(buffer, sizeof(buffer), 1, myfileP);
32
33       fprintf(STDOUT, "temp file contains '%s'\n", buffer);
34
35       fclose(myfileP);
36
37
38
39

DESCRIPTION

41       This library function is part of Netpbm(1).
42
43       pm_tmpfile() creates and opens an unnamed temporary file.  It is  basi‐
44       cally  the same thing as the standard C library tmpfile() function, ex‐
45       cept that it uses the TMPFILE environment variable to decide  where  to
46       create  the  temporary  file.  If TMPFILE is not set or is set to some‐
47       thing unusable (e.g.  too long), pm_tmpfile() falls back to  the  value
48       of the standard C library symbol P_tmpdir, just like tmpfile().
49
50       Unlike tmpfile(), pm_tmpfile() never returns NULL.  If it fails, it is‐
51       sues a message to Standard Error and aborts the program, like most lib‐
52       netpbm routines do.
53
54       If  you  need  to refer to the temporary file by name, use pm_make_tmp‐
55       file() instead.
56
57

HISTORY

59       pm_tmpfile() was introduced in Netpbm 10.20 (January 2004).
60

DOCUMENT SOURCE

62       This manual page was generated by the Netpbm tool 'makeman'  from  HTML
63       source.  The master documentation is at
64
65              http://netpbm.sourceforge.net/doc/libtmpfile.html
66
67netpbm documentation       Netpbm22suJburloyut2i0n0e4library: pm_tmpfile() function(3)
Impressum