From ca0a0b0d01355de0c3ef7e85a01a7dc4c413afe1 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 24 Jun 2005 10:22:04 +0000
Subject: [PATCH] Added notes in documentation for File.open() regarding
 modifying .ini files (file must be opened for reading and writing) and using
 file_exists() to a open new or existing file for both reading and writing.

---
 src/sbbs3/js_file.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/sbbs3/js_file.c b/src/sbbs3/js_file.c
index ed758f7b98..fa7c244d31 100644
--- a/src/sbbs3/js_file.c
+++ b/src/sbbs3/js_file.c
@@ -1581,6 +1581,11 @@ static jsSyncMethodSpec js_file_functions[] = {
 		"<tt>a+</tt> open for reading and appending<br>"
 		"<tt>b&nbsp</tt> open in binary (untranslated) mode; translations involving carriage-return and linefeed characters are suppressed (e.g. <tt>r+b</tt>)<br>"
 		"<tt>e&nbsp</tt> open a <i>non-shareable</i> file (that must not already exist) for <i>exclusive</i> access <i>(introduced in v3.12)</i><br>"
+		"<br><b>Note:</b> When using the <tt>iniSet</tt> methods to modify a <tt>.ini</tt> file, "
+		"the file must be opened for both reading and writing.<br>"
+		"<br><b>Note:</b> To open an existing or create a new file for both reading and writing, "
+		"use the <i>file_exists</i> function like so:<br>"
+		"<tt>file.open(file_exists(file.name) ? 'r+':'w+');</tt>"
 		)
 	,310
 	},		
-- 
GitLab