diff options
author | Ari Suutari <ari@stonepile.fi> | 2015-06-18 16:05:44 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-06-21 00:03:26 +0300 |
commit | 63b9e598a35e19ea87ea9de7831ec4fde75def8c (patch) | |
tree | 133c789aa9dd1a7424323f559f69cd667c5f722d /unix | |
parent | 60ccb41facc0df74c47469134c7eab6a66b29234 (diff) | |
download | micropython-63b9e598a35e19ea87ea9de7831ec4fde75def8c.tar.gz micropython-63b9e598a35e19ea87ea9de7831ec4fde75def8c.zip |
unix: Add O_WRONLY | O_CREAT to open call when opening file for append ("a").
To comply with Python semantics.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/file.c b/unix/file.c index dfe2d6e113..a7886fd3ce 100644 --- a/unix/file.c +++ b/unix/file.c @@ -161,7 +161,7 @@ STATIC mp_obj_t fdfile_open(mp_obj_t type_in, mp_arg_val_t *args) { mode |= O_WRONLY | O_CREAT | O_TRUNC; break; case 'a': - mode |= O_APPEND; + mode |= O_WRONLY | O_CREAT | O_APPEND; break; case '+': mode |= O_RDWR; |