From WikiChip
Difference between revisions of "mirc/commands/fseek"
m (Bot: de-linking old mIRC menu) |
(→Parameters) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
== Synopsis == | == Synopsis == | ||
− | /fseek - | + | /fseek -nlwrp <name> <position|N|matchtext> |
== Switches == | == Switches == | ||
* '''-l''' - sets the pointer to the beginning of the Nth line | * '''-l''' - sets the pointer to the beginning of the Nth line | ||
* '''-n''' - sets the pointer to the beginning of the next line (from the current position of the read/write pointer) | * '''-n''' - sets the pointer to the beginning of the next line (from the current position of the read/write pointer) | ||
− | * '''-w''' - sets the pointer to the beginning of the line matching the wildcard expression | + | * '''-w''' - sets the pointer to the beginning of the line matching the {{mirc|wildcard}} expression |
* '''-r''' - sets the pointer to the beginning of the line matching the regular expression | * '''-r''' - sets the pointer to the beginning of the line matching the regular expression | ||
+ | * '''-p''' - sets the pointer to the beginning of the current line, if the pointer is already at the beginning of a line, it sets the pointer to the beginning of the previous line | ||
== Parameters == | == Parameters == | ||
* '''<name>''' - the name of the file handle | * '''<name>''' - the name of the file handle | ||
− | * '''<position|N|matchtex>''' - not required if you use -n, if -l is used: a line number, if -w is used: a wildcard expression, if -r is used: a regular expression, if no switch is used, it's the position in the file (Nth byte) | + | * '''<position|N|matchtex>''' - not required if you use -n, if -l is used: a line number, if -w is used: a {{mirc|wildcard}} expression, if -r is used: a regular expression, if no switch is used, it's the position in the file (Nth byte) |
− | '''Note''': if /fseek is not successful (can't find a match with -w or -r, can't find the Nth line with -l etc), it will set the read/write pointer to the end of the file. $fopen().err is not set. | + | '''Note''': if /fseek is not successful (can't find a match with -w or -r, can't find the Nth line with -l etc), it will set the read/write pointer to the end of the file. $fopen().err is not set, but $fopen().eof is. |
== Example == | == Example == |
Latest revision as of 13:07, 30 December 2019
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The /fseek command sets the read/write pointer to the specified position in the file, position starts at 0.
Synopsis[edit]
/fseek -nlwrp <name> <position|N|matchtext>
Switches[edit]
- -l - sets the pointer to the beginning of the Nth line
- -n - sets the pointer to the beginning of the next line (from the current position of the read/write pointer)
- -w - sets the pointer to the beginning of the line matching the wildcard expression
- -r - sets the pointer to the beginning of the line matching the regular expression
- -p - sets the pointer to the beginning of the current line, if the pointer is already at the beginning of a line, it sets the pointer to the beginning of the previous line
Parameters[edit]
- <name> - the name of the file handle
- <position|N|matchtex> - not required if you use -n, if -l is used: a line number, if -w is used: a wildcard expression, if -r is used: a regular expression, if no switch is used, it's the position in the file (Nth byte)
Note: if /fseek is not successful (can't find a match with -w or -r, can't find the Nth line with -l etc), it will set the read/write pointer to the end of the file. $fopen().err is not set, but $fopen().eof is.
Example[edit]
/fseek myfile 42 /fseek -l myfile 12 /fseek -n /fseek -w *findthis* /fseek -r /findthat/
Compatibility[edit]
Added: 6.1
See also[edit]
mIRC commands list