[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  XPfunique()
  Create a unique file, handy for temporary files
------------------------------------------------------------------------------

   Function:   XPfunique()

               This function creates a unique file in a given or the current
               directory. It uses a DOS call that ensures that the file is
               truly unique. You have no control on the name of the file,
               but then, you needn't bother about an algorithm for
               the unique name. You must store the name, and use ferase()
               to delete the file, the file name is NOT truly temporary,
               just unique (that's way I didn't name it XPftemp()).

               Note that the XPuniqName() function is the function of
               choice for Unique file names. this function is only provided
               for completeness, so you have total control.

               Note that using this function is a bit tricky, as the
               string supplied also contains the return name. Also
               13 zeroes must be reserved to that effect!

   Syntax:     XPfunique([@cSlot][,nAttr]) --> nHandle

   Arguments:  cSlot is a string (by reference!!) where the name of the
               Unique file will be stored. It is a path, terminating with
               a '\'!!!!, follow it by 13 zeroes to store the resulting name.
               nAttr can optionally denote the attribute of the file to
               create and defaults to 0.

   Returns:    The handle of the file, it is thus open!. You have the full
               name in cSlot.

   Usage:      cTempFile := '.\'+Replicate(chr(0),13)
               h := XPfunique(cTempFile,0)
               ...

               Note that the path MUST always be terminated with \, so
               use .\ to indicate current directory.

               If this is all a bit tricky, have a look at XPuniqName(),
               which does most of the work to be done here. XPuniqName()
               is located in another section of the Documentation.

See Also: XPferror() XPfcreateNew()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson