* msTmpFile() * * Generate a Unique temporary file. * * Returns char* which must be freed by caller. **********************************************************************/
| 1347 | * Returns char* which must be freed by caller. |
| 1348 | **********************************************************************/ |
| 1349 | char *msTmpFile(mapObj *map, const char *mappath, const char *tmppath, const char *ext) |
| 1350 | { |
| 1351 | char szPath[MS_MAXPATHLEN]; |
| 1352 | const char *fullFname; |
| 1353 | char *tmpFileName; /* big enough for time + pid + ext */ |
| 1354 | char *tmpBase = NULL; |
| 1355 | |
| 1356 | tmpBase = msTmpPath(map, mappath, tmppath); |
| 1357 | tmpFileName = msTmpFilename(ext); |
| 1358 | |
| 1359 | fullFname = msBuildPath(szPath, tmpBase, tmpFileName); |
| 1360 | |
| 1361 | free(tmpFileName); |
| 1362 | free(tmpBase); |
| 1363 | |
| 1364 | if (fullFname) |
| 1365 | return msStrdup(fullFname); |
| 1366 | |
| 1367 | return NULL; |
| 1368 | } |
| 1369 | |
| 1370 | /********************************************************************** |
| 1371 | * msTmpPath() |
no test coverage detected