$fopen » History » Version 5
Per Amundsen, 12/14/2019 10:01 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$fopen(name|N)* |
||
4 | |||
5 | Returns information about an open file. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | name|N - Name of an open file, If N = 0 number of open files, otherwise the Nth open file. |
||
10 | |||
11 | *Properties* |
||
12 | |||
13 | .fname - Returns the name associated with the file. |
||
14 | .pos - Returns the current position in the file. |
||
15 | .eof - Returns [[$true]] if the position is as the end of the file, otherwise [[$false]]. |
||
16 | 5 | Per Amundsen | .err - *TODO* |
17 | 4 | Per Amundsen | .line - Returns the current line position. *(AdiIRC only)* |
18 | 1 | Per Amundsen | |
19 | *Example* |
||
20 | |||
21 | <pre> |
||
22 | ; Open a file. |
||
23 | /fopen Example Example.txt |
||
24 | |||
25 | 2 | Per Amundsen | ; Print number of open files. |
26 | 1 | Per Amundsen | //echo -ag $fopen(0) |
27 | |||
28 | ; Print information about the 'Example' file. |
||
29 | //echo -ag $fopen(Example) position is $fopen(Example).pos |
||
30 | |||
31 | 2 | Per Amundsen | ; Close the file. |
32 | 1 | Per Amundsen | /fclose Example |
33 | </pre> |