logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

pm_tmpfile_fd() - create a temporary unnamed file

Description

       This library function is part of Netpbm(1).

       pm_tmpfile_fd() is analogous to pm_tmpfile()(1).  The only difference is that it opens the file as a  low
       level file, as open() would, rather than as a stream, as fopen() would.

       If you need to refer to the temporary file by name, use pm_make_tmpfile_fd() instead.

Document Source

       This  manual  page was generated by the Netpbm tool 'makeman' from HTML source.  The master documentation
       is at

              http://netpbm.sourceforge.net/doc/libtmpfilefd.html

netpbm documentation                            31 December 2007     Netpbmsubroutine...pfile_fd()function(3)

Example

       This  simple  example  creates  a  temporary file, writes "hello world" to it, then reads back and prints
       those contents.

       #include <netpbm/pm.h>

       int fd;

       fd = pm_tmpfile();

       write(fd, "hello world\n", 17);

       lseek(fd, 0, SEEK_SET);

       read(fd, buffer, sizeof(buffer));

       fprintf(STDOUT, "temp file contains '%s'\n", buffer);

       close(fd);

History

pm_tmpfile() was introduced in Netpbm 10.42 (March 2008).

Name

       pm_tmpfile_fd() - create a temporary unnamed file

Synopsis

       #include <netpbm/pm.h>

       FILE *
       pm_tmpfile_fd(void);

See Also