Article # 298, added by Geoworks, historical record
| first | previous | index | next | last |

Creating a file with read-only attributes.



Q. My call to FileCreate now gets "Death due to CREATE_BAD_FLAGS"
   Here's the call

	fileHan = FileCreate("sample.rec",
		(FILE_CREATE_TRUNCATE | FCF_NATIVE |
		 FILE_ACCESS_R | FILE_DENY_NONE),
		FILE_ATTR_NORMAL);

A. As stated in the Routines book under FileCreate(), a file cannot be
   created in read-only mode.  You must open it with write access.
   And, if you open it with write access, you must open it deny-write
   for others.

   Try using FILE_ACCESS_RW | FILE_DENY_RW, as shown in the example
   which accompanies the FileCreate() reference entry.