diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-25 14:13:10 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-25 14:13:10 -0400 |
| commit | d88d8648dc7802fbeac2f28dc5f2ef8fdfe1a9e4 (patch) | |
| tree | 700d37dc77f2164cbbdc8fdc5f04afbcffe8c962 /src | |
| parent | 427cc44196630bde3d94ecec09fe4c88f085ab61 (diff) | |
Fix path:write() to truncate appropriately
Diffstat (limited to 'src')
| -rw-r--r-- | src/stdlib/paths.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c index a734426f..fae75e98 100644 --- a/src/stdlib/paths.c +++ b/src/stdlib/paths.c @@ -287,12 +287,12 @@ static void _write(Path_t path, Array_t bytes, int mode, int permissions) public void Path$write(Path_t path, Text_t text, int permissions) { Array_t bytes = Text$utf8_bytes(text); - _write(path, bytes, O_WRONLY | O_CREAT, permissions); + _write(path, bytes, O_WRONLY | O_CREAT | O_TRUNC, permissions); } public void Path$write_bytes(Path_t path, Array_t bytes, int permissions) { - _write(path, bytes, O_WRONLY | O_CREAT, permissions); + _write(path, bytes, O_WRONLY | O_CREAT | O_TRUNC, permissions); } public void Path$append(Path_t path, Text_t text, int permissions) |
