From: Caleb Clausen on
On 3/5/10, Robert Klemme <shortcutter(a)googlemail.com> wrote:
> 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.

First  |  Prev  | 
Pages: 1 2 3 4 5
Prev: Increase significant digits in Float
Next: Training