mirror of https://github.com/AxioDL/amuse.git
Better temp file handling
This commit is contained in:
parent
aa32ff7e84
commit
b40b2c031a
|
@ -560,7 +560,8 @@ static std::vector<std::pair<SystemString, IntrusiveAudioGroupData>> LoadMP2(FIL
|
|||
rem -= dsz;
|
||||
}
|
||||
|
||||
fp = FOpen(_S("amuse_tmp.dat"), _S("r+"));
|
||||
fp = FOpen(_S("amuse_tmp.dat"), _S("rw"));
|
||||
rewind(fp);
|
||||
fwrite(buf, 1, decompSz, fp);
|
||||
rewind(fp);
|
||||
}
|
||||
|
@ -609,7 +610,11 @@ static std::vector<std::pair<SystemString, IntrusiveAudioGroupData>> LoadMP2(FIL
|
|||
}
|
||||
}
|
||||
}
|
||||
if (compressed)
|
||||
{
|
||||
fclose(fp);
|
||||
Unlink(_S("amuse_tmp.dat"));
|
||||
}
|
||||
fp = old_fp;
|
||||
FSeek(fp, origPos, SEEK_SET);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue