Skip to content

Commit 4878e0c

Browse files
Merge branches 'main' and 'main' of github.com:multitheftauto/wiki.multitheftauto.com
2 parents 3583af7 + 437e947 commit 4878e0c

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

functions/File/fileOpen.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ shared: &shared
1717
- name: 'readOnly'
1818
type: 'bool'
1919
description: By default, the file is opened with reading and writing access. You can specify true for this parameter if you only need reading access.
20+
default: 'false'
2021
returns:
2122
description: If successful, returns a file handle for the file. Otherwise returns false (f.e. if the file doesn't exist).
2223
values:

web/src/pages/reference/Filepath.astro

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
3+
import { Code } from '@astrojs/starlight/components';
4+
import NoteBox from '@src/components/NoteBox.astro';
35
---
46

57
<StarlightPage frontmatter={{
@@ -14,22 +16,20 @@ import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro';
1416
<div>It is also possible to use special filepaths in order to reference files from other resources. This can be done with the following syntax:
1517
<pre><code>:&lt;resourceName&gt;/file.ext</code></pre>
1618
<p>So, for example:</p>
17-
<pre><code>xmlLoadFile ( ":helpmanager/help.xml" )</code></pre>
19+
<Code code='xmlLoadFile ( ":helpmanager/help.xml" )' lang="lua"/>
1820
</div>
1921

20-
<div class="note">
21-
<strong>Note:</strong> Server-side filepaths which refer to resources will work correctly even if the other resource is not running. However, client-side filepaths require the target resource to be running.
22-
</div>
22+
<NoteBox type='info'>Server side filepaths which refer to resources will work correctly even if the other resource is not running. However client side filepaths require the target resource to be running.</NoteBox>
2323

2424
<h3>Client file security</h3>
2525

2626
<div>
2727
<p>To protect a client file from being read by another server, prepend the filepath with <code>@</code> when the file is created:</p>
28-
<pre><code>xmlCreateFile ( "@:myresource/someinfo.xml" )</code></pre>
29-
<pre><code>fileCreate ( "@listofthings.txt" )</code></pre>
28+
<Code code='xmlCreateFile ( "@:myresource/someinfo.xml" )' lang="lua"/>
29+
<Code code='fileCreate ( "@listofthings.txt" )' lang="lua"/>
3030
<p>To read a private file, <code>@</code> must also be prepended when the file is reopened:</p>
31-
<pre><code>xmlLoadFile ( "@:myresource/someinfo.xml" )</code></pre>
32-
<pre><code>fileOpen ( "@listofthings.txt" )</code></pre>
31+
<Code code='xmlLoadFile ( "@:myresource/someinfo.xml" )' lang="lua"/>
32+
<Code code='fileOpen ( "@listofthings.txt" )' lang="lua"/>
3333
<p>Notes:</p>
3434
<ul>
3535
<li>The filepath without <code>@</code> is read/writeable by all servers.</li>

0 commit comments

Comments
 (0)