work with PIFile::openTemporary() on Windows
This commit is contained in:
@@ -148,7 +148,14 @@ PIFile::PIFile(const PIString & path, PIIODevice::DeviceMode mode): PIIODevice(p
|
|||||||
|
|
||||||
|
|
||||||
bool PIFile::openTemporary(PIIODevice::DeviceMode mode) {
|
bool PIFile::openTemporary(PIIODevice::DeviceMode mode) {
|
||||||
return open(PIString(tmpnam(0)), mode);
|
PIString tp;
|
||||||
|
char * rc = tmpnam(0);
|
||||||
|
if (!rc) return false;
|
||||||
|
tp = rc;
|
||||||
|
#ifdef WINDOWS
|
||||||
|
tp = PIDir::temporary().path() + PIDir::separator + "file" + tp.cutLeft(1).cutRight(1);
|
||||||
|
#endif
|
||||||
|
return open(tp, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user