Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/doc/en/html/macro/command/filelock.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8939 - (show annotations) (download) (as text)
Thu Oct 1 16:06:58 2020 UTC (3 years, 7 months ago) by nmaya
File MIME type: text/html
File size: 1742 byte(s)
マクロコマンドが Tera Term バージョンいくつから存在するか、それぞれのマクロコマンドのヘルプページに記載

ticket #40808
MFT to: 4-stable
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <title>filelock</title>
7 <meta http-equiv="Content-Style-Type" content="text/css">
8 <link rel="stylesheet" href="../../style.css" type="text/css">
9 </head>
10
11 <body>
12
13
14 <h1>filelock</h1>
15
16 <p>
17 Locks the specified file. <em>(version 4.74 or later)</em>
18 </p>
19
20 <pre class="macro-syntax">
21 filelock &lt;file handle&gt; [&lt;timeout&gt;]
22 </pre>
23
24 <h2>Remarks</h2>
25
26 <p>
27 Locks the specified whole file for exclusive access by the calling process. <br>
28 The &lt;timeout&gt; argument is described below.
29 </p>
30
31 <table>
32 <tr>
33 <th><b>&lt;timeout&gt;</b></th>
34 <td><b>Description</b></td>
35 </tr>
36 <tr>
37 <th>0</th>
38 <td>Returns quickly the error when the file is already locked.</td>
39 </tr>
40 <tr>
41 <th>Abbreviation</th>
42 <td>Returns only when the file is unlocked.</td>
43 </tr>
44 <tr>
45 <th>Value</th>
46 <td>Waits until the file is unlocked or the time-out interval(in seconds) elapses.
47 Returns the error when the time-out interval elapsed.</td>
48 </tr>
49 </table>
50
51 <p>
52 If the function succeeds, the system variable "result" is set to 0.<br>
53 If the function fails, the system variable "result" is set to 1.
54 </p>
55
56
57 <h2>Examples</h2>
58
59 <pre class="macro-example">
60 fileopen fhandle 'test.txt' 0
61 filelock fhandle
62 if result!=0 then
63 messagebox 'error' 'hoge'
64 endif
65 filewrite fhandle 'sample'
66 pause 60
67 fileunlock fhandle
68 if result!=0 then
69 messagebox 'error' 'hoge'
70 endif
71 fileclose fhandle
72 </pre>
73
74 <h2>See also</h2>
75 <ul>
76 <li><a href="fileunlock.html">fileunlock</a></li>
77 </ul>
78
79 </body>
80 </html>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26