⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmpfile.c

📁 标准c库代码,可以应用于各个系统提供了大量的基本函数
💻 C
字号:
/*FUNCTION<<tmpfile>>---create a temporary fileINDEX	tmpfileINDEX	_tmpfile_rANSI_SYNOPSIS	#include <stdio.h>	FILE *tmpfile(void);	FILE *_tmpfile_r(void *<[reent]>);TRAD_SYNOPSIS	#include <stdio.h>	FILE *tmpfile();	FILE *_tmpfile_r(<[reent]>)	char *<[reent]>;DESCRIPTIONCreate a temporary file (a file which will be deleted automatically),using a name generated by <<tmpnam>>.  The temporary file is opened withthe mode <<"wb+">>, permitting you to read and write anywhere in itas a binary file (without any data transformations the host system mayperform for text files).The alternate function <<_tmpfile_r>> is a reentrant version.  Theargument <[reent]> is a pointer to a reentrancy structure.RETURNS<<tmpfile>> normally returns a pointer to the temporary file.  If notemporary file could be created, the result is NULL, and <<errno>>records the reason for failure.PORTABILITYBoth ANSI C and the System V Interface Definition (Issue 2) require<<tmpfile>>.Supporting OS subroutines required: <<close>>, <<fstat>>, <<getpid>>,<<isatty>>, <<lseek>>, <<open>>, <<read>>, <<sbrk>>, <<write>>.<<tmpfile>> also requires the global pointer <<environ>>.*/#include <stdio.h>#include <errno.h>FILE *_DEFUN (_tmpfile_r, (ptr),	struct _reent *ptr){  FILE *fp;  int e;  char *f;  char buf[L_tmpnam];  if ((f = _tmpnam_r (ptr, buf)) == NULL)    return NULL;  fp = fopen (f, "wb+");  e = ptr->_errno;  _CAST_VOID remove (f);  ptr->_errno = e;  return fp;}#ifndef _REENT_ONLYFILE *_DEFUN_VOID (tmpfile){  return _tmpfile_r (_REENT);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -