]>
diplodocus.org Git - nmh/blob - sbr/m_scratch.c
3 * m_scratch.c -- construct a scratch file
12 m_scratch (char *file
, char *template)
15 static char buffer
[BUFSIZ
], tmpfil
[BUFSIZ
];
17 snprintf (tmpfil
, sizeof(tmpfil
), "%sXXXXXX", template);
19 Mkstemp work postponed until later -Doug
28 /* nasty - this really means: if there is no '/' in the path */
29 if ((cp
= r1bindex (file
, '/')) == file
)
30 strncpy (buffer
, tmpfil
, sizeof(buffer
));
32 snprintf (buffer
, sizeof(buffer
), "%.*s%s", cp
- file
, file
, tmpfil
);