0

I have some code that looks like this:

char template[] = "temp-XXXXXX";
FILE * f = mkstmp(template);

/* ... some stuff is written to f with fprintf ...*/

char fname[15] = xyzzy(f); // <-- Problem

char tmp[20];
sprintf(tmp,"less %s", fname);
system(tmp);

I need to find out the name given to f by mkstmp so I can call less on it.

SIGSTACKFAULT
  • 919
  • 1
  • 12
  • 31

1 Answers1

1

template will have been changed to the file's name. So:

sprintf(tmp,"less %s",template)
system(tmp);
SIGSTACKFAULT
  • 919
  • 1
  • 12
  • 31