From: Brian Candler Date: 2008-09-17T22:52:06+09:00 Subject: Re: Generating a semi-random, but legal, filename > I thought this would be a fun brain teaser. In short, I need a way to > generate a semi-random file name based on a template on MS Windows. > The motivation, in case you're wondering, is that I'm implementing a > pure Ruby version of the mkstemp() function, which MS Windows does not > support. Aside, for those who aren't aware, there is tempfile.rb in the Ruby standard library which does something similar: i.e. create a random name from a template, then open the file. The names it generates aren't really random, but AFAICT are guaranteed to be unique. The documentation for mkstemp doesn't make any claims to randomness either though. -- Posted via http://www.ruby-forum.com/.