A gem for handling temporary file(s)?

C

Caleb Clausen

Thanks for the link. If I understand all this right this cannot be
fixed as long as a) there are two processes involved or b) the second
process (dot) cannot be made inherit the file descriptor. An

I _think_ its ok if the parent process creates the temp file and then
the child writes its output to the existing temp file. As long as the
file isn't deleted in between those two events. And that's if the
child process doesn't object to overwriting an existing file.
alternative approach would avoid a shared directory like /tmp and
write the output in $HOME/.../somewhere - which might be slower
Right.

because /tmp is often mounted in RAM. Maybe it helps to create a
directory in /tmp which is owned by and only accessible to $USER; then
create the tempfiles in that directory.

That should work too. Just be sure that you don't ignore EEXIST when
creating the temp directory. Try with a different name instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top