[Insight-developers] portable temporary file name generator function?

Mathieu Malaterre mathieu.malaterre at gmail.com
Wed Jul 29 17:26:12 EDT 2009


On Tue, Jul 28, 2009 at 8:46 PM, kent
williams<norman-k-williams at uiowa.edu> wrote:
> I have need to generate some temporary filenames, in order to write out
> images for external programs to use as inputs.
>
> I notice there's no temporary file name generator in itksys::SystemTools.
>
> Shouldn't there be?
>
> I'd can write one, no doubt, but don't have Windows builds to test it on.
>
> Is there one buried somewhere in CMake?

The only one I found out to be working on linux and win32 was tempnam:

 char *tempnam(const char *dir, const char *pfx);

Most documentation will tell you this is a bad idea anyway and should
instead request a file (without knowing the actual filename) from the
system (eg: tmpfile).


HTH
-- 
Mathieu
http://mathieumalaterre.com


More information about the Insight-developers mailing list