Open (Daemon subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(32 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<span style="font-size:120%"><b>Open a file or group on a daemon thread.</b></span>
{{Template:Daemon:Open subtitle}}
<var>Open</var> is used to open a file or group on the daemon thread that is already open on the invoking (master) thread. The file or group is opened with the same privileges with which it is open on the master thread.


Open is a member of the [[Daemon class]]
==Syntax==
{{Template:Daemon:Open syntax}}


This method is used to open a file or group on the daemon thread that is already open on the invoking (master) thread. The file or group is opened with the same privileges with which it is open on the master thread.
===Syntax terms===
<table class="syntaxTable">
<tr><th nowrap>%daemon</th>
<td>A previously defined <var>Daemon</var> object. </td></tr>


==Open Syntax==
<tr><th>string</th>
<pre>
<td>The name of the file or group to be opened on the daemon thread. <var class="term">string</var> <b><i>is</i></b> case sensitive; you must use all-uppercase characters.
%daem:Open(fgname [, Default=bool])
<p>Use the following syntax for <var class="term">string</var> (note that Temp groups are not allowed):</p>
</pre>
<p class="syntax"><span class="squareb">[</span><span class="literal">File</span> <span class="squareb">| [</span><span class="literal">Perm</span><span class="squareb">]</span> <span class="literal">Group</span><span class="squareb">]</span> <span class="term">name</span><span class="squareb">]</span> </p></td></tr>


===Syntax Terms===
<tr><th><var>Default</var></th>
<td>An optional, [[Methods#Named parameters|name required]], parameter which specifies whether the file or group to be opened will be the default file or group for this the daemon thread. <var>Default</var> is a [[Boolean enumeration]] that defaults to <var>False</var>, meaning that the <var>Open</var> method does not change the default file on the daemon thread.</td></tr>
</table>
 
==Exceptions==
This subroutine can throw the following exceptions:
<dl>
<dl>
<dt><i>%daem</i>
<dt><var>[[DaemonLost_class|DaemonLost]]</var>  
<dd>A previously defined Daemon object.
<dd>If the daemon object is lost (probably restarted), a <var>DaemonLost</var> exception is thrown. This exception will only be thrown in <var class="product">Sirius Mods</var> Version 7.6 and later.  
<dt><i>fgname</i>  
<dd>The name of the file or group to be opened on the daemon thread. You must use all uppercase characters.
 
Use the following format for '''%fgname''' (note that Temp groups are not allowed):
 
<pre>
[File | [Perm] Group] <i>name</i>]
</pre>
<dt>Default=<i>bool</i>
<dd>This NameRequired, optional parameter specifies whether the file or group to be opened will be the default file or group on the daemon thread. Either of the Boolean enumeration values is valid: :lit.True:elit. or <tt>False</tt>. The default value for Default is <tt>False</tt>, meaning that, by default, the Open method does not change the default file on the daemon thread.</dl>


==Exceptions==
<dt><var>[[IncorrectDaemonState class|IncorrectDaemonState]]</var>  
<dd>If the daemon thread is asynchronous,
This subroutine can throw the following exceptions:<dl>
an <var>IncorrectDaemonState</var> exception is thrown. This exception will only be thrown in <var class="product">Sirius Mods</var> version 8.1 and later.  
<dt>DaemonLost
<dd>If the daemon object is lost (probably restarted), a [[DaemonLost exception]] is thrown. This exception will only be thrown in ''[[Sirius Mods]]''.
</dl>
</dl>


==Usage Notes==
==Usage notes==
<ul>
<ul>
<li>The Open method cannot open a file or group that is not already open on the master thread. To open a file not open on the master thread, issue an OPEN command using the [[Run (Daemon function)]].  
<li><var>Open</var> cannot open a file or group that is not already open on the master thread. To open a file not open on the master thread, issue an <var>OPEN</var> command using the <var>[[Run (Daemon function)|Run]]</var> method.
<li>These are example Open calls:
<li>It is a request-cancelling error to use <var>Open</var> against a file or group that the issuing user does not have open.
<li>It is a (catchable) request-cancelling error if a group open fails because of an FTBL full condition.</ul>
 
==Examples==
These are all valid <var>Open</var> calls:
<p class="code">%daem:open('MYPROC')


<pre>
%daem:open('MYPROC')
%daem:open('GROUP SIRSYS')
%daem:open('GROUP SIRSYS')
%daem:open('PERM GROUP MUMBLE')
%daem:open('PERM GROUP MUMBLE')
%daem:open('FILE SIRLOCAL')
%daem:open('FILE SIRLOCAL')
</pre>
</p>
<li>It is a request-cancelling error to use Open against a file or group that the issuing user does not have open. It is a (catchable) request-cancelling error if a group open fails because of an FTBL full condition.</ul>


[[Category:Daemon class|Open]]
==See also==
[[Category:System methods]]
{{Template:Daemon:Open footer}}

Latest revision as of 00:05, 30 January 2013

Open a file/group on the Daemon thread (Daemon class)

Open is used to open a file or group on the daemon thread that is already open on the invoking (master) thread. The file or group is opened with the same privileges with which it is open on the master thread.

Syntax

daemon:Open( string, [Default= boolean]) Throws DaemonLost, IncorrectDaemonState

Syntax terms

%daemon A previously defined Daemon object.
string The name of the file or group to be opened on the daemon thread. string is case sensitive; you must use all-uppercase characters.

Use the following syntax for string (note that Temp groups are not allowed):

[File | [Perm] Group] name]

Default An optional, name required, parameter which specifies whether the file or group to be opened will be the default file or group for this the daemon thread. Default is a Boolean enumeration that defaults to False, meaning that the Open method does not change the default file on the daemon thread.

Exceptions

This subroutine can throw the following exceptions:

DaemonLost
If the daemon object is lost (probably restarted), a DaemonLost exception is thrown. This exception will only be thrown in Sirius Mods Version 7.6 and later.
IncorrectDaemonState
If the daemon thread is asynchronous, an IncorrectDaemonState exception is thrown. This exception will only be thrown in Sirius Mods version 8.1 and later.

Usage notes

  • Open cannot open a file or group that is not already open on the master thread. To open a file not open on the master thread, issue an OPEN command using the Run method.
  • It is a request-cancelling error to use Open against a file or group that the issuing user does not have open.
  • It is a (catchable) request-cancelling error if a group open fails because of an FTBL full condition.

Examples

These are all valid Open calls:

%daem:open('MYPROC') %daem:open('GROUP SIRSYS') %daem:open('PERM GROUP MUMBLE') %daem:open('FILE SIRLOCAL')

See also