mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 05:43:19 -08:00
Files opened with :overwrite or :append were truncated.
This commit is contained in:
parent
d52383c27e
commit
6f01cc89c6
1 changed files with 5 additions and 1 deletions
|
|
@ -4172,10 +4172,14 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists,
|
|||
if (flags & ECL_STREAM_C_STREAM) {
|
||||
FILE *fp;
|
||||
close(f);
|
||||
/* We do not use fdopen() because Windows seems to
|
||||
* have problems with the resulting streams. Furthermore, even for
|
||||
* output we open with w+ because we do not want to
|
||||
* overwrite the file. */
|
||||
switch (smm) {
|
||||
case smm_probe:
|
||||
case smm_input: fp = fopen(fname, OPEN_R); break;
|
||||
case smm_output: fp = fopen(fname, OPEN_W); break;
|
||||
case smm_output:
|
||||
case smm_io: fp = fopen(fname, OPEN_RW); break;
|
||||
}
|
||||
x = ecl_make_stream_from_FILE(fn, fp, smm, byte_size, flags,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue