home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / ttempna2.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  959 b   |  38 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TTempName
  4. //    Include File:    ttempnam.h
  5. //    Purpose:    Standardized way of creating a temporary file name.
  6. //    Remarks/Portability/Dependencies/Restrictions:
  7. //    Revision History:
  8. //        02-15-94    created
  9. #include"ttempnam.h"
  10. #include"trace.h"
  11. #include<stdlib.h>
  12. #include<dir.h>
  13.  
  14. TTempName::~TTempName()    {
  15. //    Purpose:    Destructor
  16. //    Arguments:    void
  17. //    Return Value:    none
  18. //    Remarks/Portability/Dependencies/Restrictions:
  19. //    Revision History:
  20. //        02-15-94    created
  21.  
  22.     //    If there is temporary memory to release.
  23.     if(cp_TempName != NULL)    {
  24.         //    If the file exists, delete it.
  25.         struct ffblk ffblk_info;
  26.         int i_done;
  27.         i_done = ::findfirst(cp_TempName, &ffblk_info, 0);
  28.         if(i_done == 0)    {
  29. #ifndef RELEASE
  30.             trace("deleting temporary file " << cp_TempName);
  31. #endif // RELEASE
  32.             unlink();
  33.         }
  34.  
  35.         //    Release the name space.
  36.         ::free((void *)cp_TempName);
  37.     }
  38. }