creating a temporary fifo (tmpfile but for fifo)

Paul Backus via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 13 09:12:19 PST 2017


On Sunday, 12 February 2017 at 11:47:26 UTC, Timothee Cour wrote:
> * std.stdio.tempfile creates an (unnamed) File. How do I create 
> a temporary
> fifo instead?
> my workaround is to use tempnam but docs says it's not 
> recommended (
> http://man7.org/linux/man-pages/man3/tempnam.3.html)

I believe the recommended function for this is mkstemp. [1]

> * could we allow specifying a directory name for tmpfile?

Yes, using mkdtemp. [2]

Note that these functions are part of POSIX but not C99, and are 
not included in D's core.stdc module.

[1] http://man7.org/linux/man-pages/man3/mkstemp.3.html
[2] http://man7.org/linux/man-pages/man3/mkdtemp.3.html


More information about the Digitalmars-d mailing list