home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CLIPB52.ZIP / SCHINKEL.ZIP / FUNIQUE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-17  |  834 b   |  45 lines

  1. /* FUNIQUE.C
  2.  
  3.      Purpose: Returns a unique file name.
  4.  
  5.      Calling: cFileName:= FUnique([cPathSpec[,nFileAttribute]])
  6.  
  7.      Returns: Unique file name plus prepended pathspec.
  8.  
  9.      Errors:  Check FERR() for DOS Error.
  10.  
  11.    Copyright (c) 1990; The DSW Group, Ltd.  All Rights Reserved.
  12.  
  13. */
  14.  
  15. #include "h:\clipper\nandef.h"
  16. #include "h:\clipper\extend.h"
  17.  
  18. char tfile[65]= "";
  19. /*...........................................................*/
  20. CLIPPER funique() /* FUnique(cPath,nAttr) -> cUniqueFileName */
  21. {
  22.    int handle,mode,pcnt;
  23.    char *tpath;
  24.  
  25.    mode= ((pcnt= PCOUNT)>=2) ? _parni(2) : 0;
  26.    tpath= (pcnt>=1) ? _parc(1) : tfile;
  27.  
  28.    _tclose(_tctemp(tpath,mode,tfile));
  29.    _retc(tfile);
  30. }
  31. /*...........................................................*/
  32. /* EOF: FUNIQUE.C */
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.