home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!utoday!infopro!neptons
- From: roger@neptons.UUCP (Roger Barth)
- Subject: Re: core dump using mktemp()
- Newsgroups: comp.os.coherent
- Date: 14 Sep 92 06:59:15 GMT
- Distribution: world
- Message-ID: <744257@neptons.UUCP>
- Organization: Cameron Park, CA
- Sender: news@neptons.UUCP (GNEWS Version 3.0 news poster.)
- Lines: 30
-
- dfilip@colorne.UUCP writes:
- > Can someone please tell me what I am doing wrong ? The following code
- > segment core dumps (segmentation violation) on me :
- >
- > #include <stdio.h>
- >
- > char msgtemp[33];
- >
- > extern char *mktemp();
- >
- > main()
- > {
- > printf("before call to mktemp\n");
- >
- > strcpy(msgtemp,mktemp("/tmp/sortXXXXXX"));
- mktemp does not work in 4.0. I ran into the problem when porting
- over COMB to version 4.0. the best I can suggest is to user the
- process ID appended to something for a temp file. I also keep a
- temp counter which I append to the process id.
-
- A file name can be make like:
-
- sfprint(buffer,"/tmp/tmp%d%d",getpid(),count++);
-
- --
-
- ----
- Roger Barth - Cameron Park, California USA Coherent 4.0.1
- roger%neptons@antares.intel.com 916-677-9771 (voice)
- --------------------------------------------------------------------
-