mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
not just a windows thing
This commit is contained in:
parent
dba252933d
commit
ad2e154a5d
@ -1208,16 +1208,14 @@ open_write(ofstream &stream, bool truncate) const {
|
|||||||
open_mode |= ios::trunc;
|
open_mode |= ios::trunc;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef WIN32_VC
|
// Some systems insist on having ios::in set to prevent the file
|
||||||
// Windows insists on having ios::in set to prevent the file from
|
// from being truncated when we open it. Makes ios::trunc kind of
|
||||||
// being truncated when we open it. Makes ios::trunc kind of
|
|
||||||
// pointless, doesn't it? On the other hand, setting ios::in also
|
// pointless, doesn't it? On the other hand, setting ios::in also
|
||||||
// seems to imply ios::nocreate (!), so we should only set this if
|
// seems to imply ios::nocreate (!), so we should only set this if
|
||||||
// the file already exists.
|
// the file already exists.
|
||||||
if (exists()) {
|
if (exists()) {
|
||||||
open_mode |= ios::in;
|
open_mode |= ios::in;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_IOS_BINARY
|
#ifdef HAVE_IOS_BINARY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user