home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / coherent / 4516 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  1.2 KB

  1. Path: sparky!uunet!utoday!infopro!neptons
  2. From: roger@neptons.UUCP (Roger Barth)
  3. Subject: Re: core dump using mktemp()
  4. Newsgroups: comp.os.coherent
  5. Date: 14 Sep 92 06:59:15 GMT
  6. Distribution: world
  7. Message-ID: <744257@neptons.UUCP>
  8. Organization: Cameron Park, CA
  9. Sender: news@neptons.UUCP (GNEWS Version 3.0 news poster.)
  10. Lines: 30
  11.  
  12. dfilip@colorne.UUCP writes:
  13. > Can someone please tell me what I am doing wrong ? The following code
  14. > segment core dumps (segmentation violation) on me :
  15. > #include <stdio.h>
  16. > char msgtemp[33];
  17. > extern char *mktemp();
  18. > main()
  19. > {
  20. >     printf("before call to mktemp\n");
  21. >     strcpy(msgtemp,mktemp("/tmp/sortXXXXXX"));
  22. mktemp does not work in 4.0.  I ran into the  problem when porting
  23. over COMB to version 4.0.  the best I can suggest is to user the
  24. process ID appended to something for a temp file.  I also keep a
  25. temp counter which I append to the process id.  
  26.  
  27. A file name can be make like:
  28.  
  29. sfprint(buffer,"/tmp/tmp%d%d",getpid(),count++);
  30.  
  31. --
  32.  
  33. ----
  34. Roger Barth - Cameron Park, California USA            Coherent 4.0.1
  35. roger%neptons@antares.intel.com                 916-677-9771 (voice)
  36. --------------------------------------------------------------------
  37.