Linked Questions

17 votes
6 answers
34k views

I'm writing a function in C++ which creates a temporary directory. Such function should be as most portable as possible, e.g. it should work under linux, mac and win32 environments. How do I achieve ...
Igor Gatis's user avatar
  • 4,948
25 votes
2 answers
22k views

I made a google search about "anonymous inode" and it seems it's related to epoll ... but what actually is it?
mrkschan's user avatar
  • 729
32 votes
2 answers
12k views

std::filesystem on C++17, and std::experimental::filesystem for many pre-C++17 compilers, are based on boost::filesystem and almost all of it is obvious to port to the newer std. But I see no std::...
Larry Gritz's user avatar
  • 13.7k
11 votes
7 answers
9k views

In C++, on Linux, how can I write a function to return a temporary filename that I can then open for writing? The filename should be as unique as possible, so that another process using the same ...
J Miller's user avatar
  • 990
12 votes
1 answer
20k views

(Note: This is not a duplicate question) I'm using the libc function tmpnam, and getting the following warning: warning: the use of 'tmpnam' is dangerous, better use 'mkstemp' My question isn't "...
Sod Almighty's user avatar
  • 1,856
3 votes
5 answers
4k views

I need to generate random names which I'll be using to create temporary files in a directory. Currently I am using C standard function tempnam() for this. My code is in C++ and would like to use C++ ...
rockoder's user avatar
  • 747
3 votes
2 answers
3k views

My C++ winAPI application has a need to create a temporary file prior to uploading the file to a server. So I have searched ways to create a temporary file & found there are many ways to do this. ...
sazr's user avatar
  • 26.2k
8 votes
1 answer
8k views

tmpfile () functions says that: The temporary file created is automatically deleted when the stream is closed (fclose) or when the program terminates normally. If the program terminates abnormally, ...
user avatar
0 votes
2 answers
2k views

Emulating multithreading by loading a DLL multiple times (it's designed for this). Since LoadLibrary() doesn't really allow it, the DLL copies itself into a temporary file, via GetTempPath() and ...
Silviu-Marian's user avatar
1 vote
2 answers
2k views

I want to create temporary files in given temporary directory path in Windows through C++. mktemp() does the required job, but it only creates 26 unique files. mkstemp() is working fine in Linux but ...
raj's user avatar
  • 11
13 votes
3 answers
2k views

I'm writing a library. In one of my unit tests, I want to create a temporary file (possibly using its path rather than its handle), make some library calls involving that file, and delete the file on ...
einpoklum's user avatar
  • 137k
-1 votes
1 answer
941 views

I am trying to create a temporary file in my C++ program by calling the tmpfnam function to get the temporary file name and using that to create the file for writing, but my code is unable to create ...
adi's user avatar
  • 590
3 votes
1 answer
416 views

I'm trying to get a temporary filename so I can use it in an argument to a child process. The child process will output to that file, then I'll open the file, read the contents, and delete the file. ...
Stewart's user avatar
  • 5,210
0 votes
1 answer
435 views

I am working on an Android project having native libraries in C++. Somewhere in the code, I encounter this line which tries to create a new file: namespace fs = boost::filesystem; dest_path = fs::...
Vivek Mangal's user avatar
0 votes
1 answer
277 views

How do i make a dummy file? I'm using Visual C++ for a form and I need it to make a dummy file. I know how to use things like fstream to write to files but how can I do it so that I know the exact ...
big boi's user avatar
  • 37

15 30 50 per page