Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tmpfile(3s) [hpux man page]

tmpfile(3S)															       tmpfile(3S)

NAME
tmpfile() - create a temporary file SYNOPSIS
DESCRIPTION
creates a temporary file by generating a name through (see tmpnam(3S)), and returns a corresponding pointer. If the file cannot be opened a NULL pointer is returned. The file is automatically deleted when the process using it terminates. The file is opened for update Notes On HP-UX systems, the mode is equivalent to the mode. ERRORS
The function will fail if: [EOVERFLOW] The named file is a regular file and the size of the file cannot be represented correctly in an object of size in this environment. Additional values may be set by the underlying function (see fopen(3S)). SEE ALSO
creat(2), unlink(2), mktemp(3C), fopen(3S), fgetpos64(3S), tmpnam(3S), thread_safety(5). STANDARDS CONFORMANCE
tmpfile(3S)

Check Out this Related Man Page

tmpfile(3C)						   Standard C Library Functions 					       tmpfile(3C)

NAME
tmpfile - create a temporary file SYNOPSIS
#include <stdio.h> FILE *tmpfile(void); DESCRIPTION
The tmpfile() function creates a temporary file and opens a corresponding stream. The file will automatically be deleted when all refer- ences to the file are closed. The file is opened as in fopen(3C) for update (w+). The largest value that can be represented correctly in an object of type off_t will be established as the offset maximum in the open file description. RETURN VALUES
Upon successful completion, tmpfile() returns a pointer to the stream of the file that is created. Otherwise, it returns a null pointer and sets errno to indicate the error. ERRORS
The tmpfile() function will fail if: EINTR A signal was caught during the execution of tmpfile(). EMFILE There are OPEN_MAX file descriptors currently open in the calling process. ENFILE The maximum allowable number of files is currently open in the system. ENOSPC The directory or file system which would contain the new file cannot be expanded. The tmpfile() function may fail if: EMFILE There are FOPEN_MAX streams currently open in the calling process. ENOMEM Insufficient storage space is available. USAGE
The stream refers to a file which is unlinked. If the process is killed in the period between file creation and unlinking, a permanent file may be left behind. The tmpfile() function has a transitional interface for 64-bit file offsets. See lf64(5). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
unlink(2), fopen(3C), mkstemp(3C), mktemp(3C), tmpnam(3C), lf64(5), standards(5) SunOS 5.10 4 Aug 2003 tmpfile(3C)
Man Page

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting another user's files

hi, I have two users, let us call them A and B. I do as User A touch tmpfile chmod 700 tmpfile Now as User B I do rm tmpfile - and it allows me to do it (after prompting me)...why? If I had done chmod 777 tmpfile, then sure User B should be able to delete it, but I did chmod 700... (3 Replies)
Discussion started by: JamesByars
3 Replies

2. Shell Programming and Scripting

best way to insert a line at the top of a file?

say I want to insert "this is a test" as the first line into file A, besides echo "this is a test" > /tmp/tmpfile cat /tmp/tmpfile fileA >> /tmp/result, is there any simple way I can do it? thanks (7 Replies)
Discussion started by: fedora
7 Replies

3. Shell Programming and Scripting

Text data string conversion to Integer

Folks Appreciate your help in understanding issue in relation to below. I need to pul uvalue from a file (tmpfile) and compare it with a number to make decision. Using #!/bin/sh contents of tmpfile : Slot uvalue : 0.16 How I am pulling it: unifval=`awk '/uvalue/ {print $4}' tmpfile` ... (1 Reply)
Discussion started by: wndgs
1 Replies

4. Solaris

No space left on device

We are using this function tmpfile() : FILE *tmpfp ; if ((tmpfp = tmpfile()) == NULL) { fprintf(stderr, "%s: ERROR: init_operator(): ", ROUTINE); perror("tmpfile()"); exit(ERR_OPEN); } and the above is raising error : MSMD0603: ERROR:... (3 Replies)
Discussion started by: atiato
3 Replies

5. Shell Programming and Scripting

optargs processing

Hello i'm writing some analyzing script and i'm giving to my program these parameters, for example: ./procinfo -r tmpfile sh -c "cat tmpfile" where -r is proccessed in getopts and it takes an argument by OPTARG.. The thing is I need to save this part to some variable: sh -c "cat tmpfile"... (4 Replies)
Discussion started by: midin
4 Replies

6. Shell Programming and Scripting

Mac. PHP fopen() does not create a file. Permissions.

5Thank you to those who responded. After a crazy amount of troubleshooting and getting hints and feedback from others, I was so darn determined to get on with my tutorials and I found the solution myself. Keyword search: php and 'Mac computer' and fopen and chmod. Using:php and Mac and... (1 Reply)
Discussion started by: iHaveAQuestion
1 Replies