Unix and Linux Discussions Tagged with temporary |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
1,702 |
Shell Programming and Scripting |
|
|
|
4 |
6,790 |
Shell Programming and Scripting |
|
|
|
5 |
21,228 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,637 |
Software Releases - RSS News |
|
|
|
0 |
1,190 |
Security Advisories (RSS) |
|
|
|
0 |
1,500 |
Security Advisories (RSS) |
|
|
|
4 |
8,190 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
6,735 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
5,122 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
5,441 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,090 |
UNIX for Dummies Questions & Answers |
|
|
|
7 |
6,317 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
6,097 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,013 |
Programming |
|
|
|
1 |
10,278 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
78,979 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
25,457 |
UNIX for Dummies Questions & Answers |
|
|
|
9 |
40,387 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,209 |
IP Networking |
Netpbm subroutine library: pm_tmpfile() function(3) Library Functions Manual Netpbm subroutine library: pm_tmpfile() function(3)
NAME
pm_tmpfile() - create a temporary unnamed file
SYNOPSIS
#include <netpbm/pm.h>
FILE *
pm_tmpfile(void);
EXAMPLE
This simple example creates a temporary file, writes 'hello world' to it, then reads back and prints those contents.
#include <netpbm/pm.h>
FILE * myfileP;
myfile = pm_tmpfile();
fprintf(myfile, 'hello world
');
fseek(myfileP, 0, SEEK_SET);
fread(buffer, sizeof(buffer), 1, myfileP);
fprintf(STDOUT, 'temp file contains '%s'
', buffer);
fclose(myfileP);
DESCRIPTION
This library function is part of Netpbm(1)
pm_tmpfile() creates and opens an unnamed temporary file. It is basically the same thing as the standard C library tmpfile() function,
except that it uses the TMPFILE environment variable to decide where to create the temporary file. If TMPFILE is not set or is set to
something unusable (e.g. too long), pm_tmpfile() falls back to the value of the standard C library symbol P_tmpdir, just like tmpfile().
Unlike tmpfile(), pm_tmpfile() never returns NULL. If it fails, it issues a message to Standard Error and aborts the program, like most
libnetpbm routines do.
If you need to refer to the temporary file by name, use pm_make_tmpfile() instead.
HISTORY
pm_tmpfile() was introduced in Netpbm 10.20 (January 2004).
netpbm documentation 22 July 2004 Netpbm subroutine library: pm_tmpfile() function(3)