From 5b6fd3208b1923069f84eb1b30e63b7479af854f Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Tue, 10 Aug 2004 02:14:26 +0000 Subject: [PATCH] File.open() now supports "e" mode character for exclusive-open of non-shareable files - using open(...,O_EXCL). --- src/sbbs3/js_file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sbbs3/js_file.c b/src/sbbs3/js_file.c index 03d270414e..74943233ea 100644 --- a/src/sbbs3/js_file.c +++ b/src/sbbs3/js_file.c @@ -114,6 +114,9 @@ static int fopenflags(char *mode) flags|=O_RDONLY; } + if(strchr(mode,'e')) + flags|=O_EXCL; + return(flags); } @@ -1490,6 +1493,7 @@ static jsSyncMethodSpec js_file_functions[] = { "<tt>w+</tt> open an empty file for both reading and writing; if the given file exists, its contents are destroyed<br>" "<tt>a+</tt> open for reading and appending<br>" "<tt>b </tt> open in binary (untranslated) mode; translations involving carriage-return and linefeed characters are suppressed (e.g. <tt>r+b</tt>)<br>" + "<tt>e </tt> open a <i>non-shareable</i> file (that must not already exist) for <i>exclusive</i> access<br>" ) ,310 }, -- GitLab