Browse Subversion Repository
Annotation of /trunk/doc/en/html/macro/command/fileopen.html
Parent Directory
| Revision Log
1 |
maya |
332 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
|
|
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
maya |
561 |
<html> |
4 |
|
|
<head> |
5 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
6 |
|
|
<title>fileopen</title> |
7 |
|
|
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
|
|
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
|
|
</head> |
10 |
yutakapon |
244 |
|
11 |
maya |
561 |
<body> |
12 |
yutakapon |
244 |
|
13 |
|
|
|
14 |
maya |
561 |
<h1>fileopen</h1> |
15 |
yutakapon |
244 |
|
16 |
maya |
495 |
<p> |
17 |
maya |
561 |
Opens a file. |
18 |
maya |
495 |
</p> |
19 |
yutakapon |
244 |
|
20 |
maya |
561 |
<pre class="macro-syntax"> |
21 |
|
|
fileopen <file handle> <filename> <append flag> |
22 |
|
|
</pre> |
23 |
yutakapon |
244 |
|
24 |
maya |
561 |
<h2>Remarks</h2> |
25 |
|
|
|
26 |
maya |
495 |
<p> |
27 |
maya |
561 |
Opens a file specified by <file name>.<br> |
28 |
|
|
If the file does not exist, it is created and then opened. If the file is successfully opened, the file handle is returned in the integer variable <file handle>. Otherwise, <file handle> is set to -1.<br> |
29 |
maya |
898 |
If <append flag> is zero, the file pointer is set to the beginning of the file. If <append flag> is non-zero, the file pointer is set to the end of the file. |
30 |
maya |
495 |
</p> |
31 |
|
|
|
32 |
maya |
561 |
<h2>Example</h2> |
33 |
yutakapon |
244 |
|
34 |
maya |
561 |
<pre class="macro-example"> |
35 |
maya |
1034 |
fileopen fhandle 'data.dat' 0 |
36 |
maya |
561 |
fileopen fhandle 'data.dat' 1 |
37 |
maya |
1034 |
</pre> |
38 |
maya |
561 |
|
39 |
yutakapon |
1032 |
<pre class="macro-example"> |
40 |
|
|
fileopen fhandle 'test.bat' 0 |
41 |
|
|
filewrite fhandle 'md .\v20080619_Test' |
42 |
|
|
fileclose fhandle |
43 |
|
|
pause 5 |
44 |
|
|
exec 'cmd /c test.bat' |
45 |
|
|
pause 10 |
46 |
|
|
exit |
47 |
maya |
1034 |
</pre> |
48 |
yutakapon |
1032 |
|
49 |
maya |
561 |
</body> |
50 |
|
|
</html> |
|