libMesh
Loading...
Searching...
No Matches
win_mkstemp.h
Go to the documentation of this file.
1/*
2 * This code is in public domain
3 */
4
5#ifndef _WIN_MKSTEMP_H_
6#define _WIN_MKSTEMP_H_
7
8#ifdef _MSC_VER
9#include <sys/stat.h>
10#include <fcntl.h>
11#include <io.h>
12
13inline int mkstemp(char *tmpl)
14{
15 char *fn = _mktemp(tmpl);
16 if (fn == NULL)
17 return -1;
18
19 return _open(fn, _O_RDWR | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE);
20}
21#else
22#error "mkstemp() is not implemented"
23#endif
24
25#endif // _WIN_MKSTEMP_H_
int mkstemp(char *tmpl)
Definition win_mkstemp.h:13