On Thu, 8 Jun 2000, Daniel O'Connor wrote:

doconn> On 08-Jun-00 Kris Kennaway wrote:
doconn> >  On Thu, 8 Jun 2000, Boris Popov wrote:
doconn> >  
doconn> > > > Instead of using only alphabetic characters, the patch uses the following
doconn> > > > character set:
doconn> > > > 
doconn> > >     Symbols '=' and '+' are prohibited in some other filesystems. It
doconn> > > is possible to avoid using them ?
doconn> >  Yes, but at the expense of weakening the number of possible random
doconn> >  filenames :-(
doconn> IMHO the loss of 2 characters doesn't greatly reduce the number of
doconn> possibilities, but it DOES greatly reduce the chance of an obscure error
doconn> message appearing when you try and make a temp file on a brain dead FS.

mkstemp() actually creates the file if possible.  If the creation of the
file fails (and not due to race condition), retry the algorithm without
'suspect' characters.  That way, you don't lose out on the extra 13% of
possibilities when running on a 'real' filesystem ;)

Since mktemp() only returns the suggested filename, you lose, unless
mktemp() starts examining the mounted filesystems for known character

Its a pity that one cannot pass the allowable list of characters to
mktemp() and related functions.


Common Sense, Inc.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to