Quantcast
Channel: Parrot: Ticket #955: need ability to create tempfile from PIR
Viewing all articles
Browse latest Browse all 7

comment added

$
0
0

What about implementing something like the O_TEMPORARY flag with parrot's open op? (a file opened with the O_TEMPORARY flag is created with a unique name, and will be deleted by the OS when close() is called on the last open file descriptor for the tempfile)

On Linux, this could be done with the mkstemp() function from libc. The PIR syntax could be something like open "template", 't' (see 'man 3 mkstemp' for what I mean by "template")

I think something similar could be implemented for Windows using the GetTempFileName, GetTempFilePath, and CreateFile functions.

Any reasons why this would not be a good way to go about it?


Viewing all articles
Browse latest Browse all 7

Trending Articles