From 56199976829f7a966a10f1be8a311112a2e143d4 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sun, 3 Mar 2024 00:49:24 -0800 Subject: [PATCH] Fix create-file to truncate file. --- posix/posix.fs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/posix/posix.fs b/posix/posix.fs index 6de4cb4..e4959bd 100644 --- a/posix/posix.fs +++ b/posix/posix.fs @@ -104,7 +104,8 @@ octal 1 constant O_WRONLY 2 constant O_RDWR 100 constant O_CREAT -200 constant O_TRUNC +200 constant O_EXCL +1000 constant O_TRUNC 2000 constant O_APPEND 4000 constant O_NONBLOCK decimal @@ -179,7 +180,7 @@ O_RDWR constant R/W : FLUSH-FILE ( fh -- ior ) fsync 0r s>z r> 0777 open sign-extend d0r s>z r> O_CREAT or 0777 open sign-extend d0r s>z r> O_CREAT O_TRUNC or or 0777 open sign-extend d0z unlink 0z -rot s>z swap rename 0r write r> = 0=ior ;