1Netpbm subroutine libraryN:etpLpmib_bmtrmasprufybirlFoeuu_ntfcidtn(ie)onlfsiubnMrcaatnriuyoa:nl(p3m)_tmpfile_fd() function(3)
2
3
4
6 pm_tmpfile_fd() - create a temporary unnamed file
7
8
10 #include <netpbm/pm.h>
11
12 FILE *
13 pm_tmpfile_fd(void);
14
15
16
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 int fd;
24
25 fd = pm_tmpfile();
26
27 write(fd, "hello world\n", 17);
28
29 lseek(fd, 0, SEEK_SET);
30
31 read(fd, buffer, sizeof(buffer));
32
33 fprintf(STDOUT, "temp file contains '%s'\n", buffer);
34
35 close(fd);
36
37
38
39
41 This library function is part of Netpbm(1).
42
43 pm_tmpfile_fd() is analogous to pm_tmpfile()[22m(1). The only difference
44 is that it opens the file as a low level file, as open() would, rather
45 than as a stream, as fopen() would.
46
47 If you need to refer to the temporary file by name, use pm_make_tmp‐
48 file_fd() instead.
49
50
52 pm_tmpfile() was introduced in Netpbm 10.42 (March 2008).
53
55 This manual page was generated by the Netpbm tool 'makeman' from HTML
56 source. The master documentation is at
57
58 http://netpbm.sourceforge.net/doc/libtmpfilefd.html
59
60netpbm documentation Netpbm 3s1ubDreocuetmibneerl2i0b0r7ary: pm_tmpfile_fd() function(3)