17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

● Files may be restricted by the implementation of an OPEN statement which allows a<br />

process to specify an access to the successfully opened file. The access determines a<br />

guaranteed exclusivity range on that file by the process while the OPEN statement is in<br />

effect.<br />

lock can be one of the following:<br />

SHARED "deny none" mode. No restrictions are placed on the read/write accessibility<br />

of the the file to another process, except that the default mode is not allowed<br />

by any of the modes including SHARED.<br />

LOCK READ "deny read" mode. Once a file is opened with the LOCK READ access, no<br />

other process is granted read-access to that file. An attempt to open a file<br />

with this access will be unsuccessful, if the file is currently open in default<br />

mode or with a read access.<br />

LOCK WRITE "deny write" mode. A file successfully opened with LOCK WRITE access<br />

may not be opened for a write access by another process. An attempt to open<br />

a file with this access will be unsuccessful if the file has been opened in<br />

default mode, or with a write access by another process.<br />

LOCK READ WRITE"deny all" or "exclusive" mode. If a file is successfully opened with this<br />

access, the process has exclusive access to the file. A file that is currently<br />

open in this mode cannot be opened again in any mode by any process.<br />

default "compatibility" mode, in which the compatibility with other BASICs is<br />

understood. No access is specified. The file may be opened any number of<br />

times by a process, provided that the file is not currently opened by another<br />

process. Other processes are denied access to the file while it is open under<br />

default access. Therefore, it is functionally exclusive.<br />

When an attempt is made to open a file that has been previously accessed by another process, the<br />

error "Permission Denied" will result. An example of a situation generating this error is when<br />

a process attempts to OPEN SHARED on a file that is already OPEN LOCK READ WRITE by<br />

another process.<br />

If an OPEN statement fails because the mode is incompatible with network-installed sharing<br />

access to a device, the error generated is "Path/File Access Error." An example of this is<br />

when a process is attempting to OPEN a file for output on a directory that has been shared for read<br />

only.<br />

For more information about using files in a networking environment, see the LOCK and<br />

UNLOCK statements.<br />

Examples:<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/OPEN.html (4 of 5)28/03/2004 21.29.39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!