From WikiChip
Editing mirc/commands/bread
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
The '''/bread command''' can be used to read a certain amount of bytes from a file at a given position and store it in a binary variable. | The '''/bread command''' can be used to read a certain amount of bytes from a file at a given position and store it in a binary variable. | ||
− | + | The beginning of the file is position 0. | |
== Synopsis == | == Synopsis == | ||
− | /bread - | + | /bread -t <filename> <bytepos> <numbytes> <&bvar> |
== Switches == | == Switches == | ||
− | * '''-t''' - Reads data | + | * '''-t''' - Reads data up to the next CR/LF |
− | |||
== Parameters == | == Parameters == | ||
− | * '''<filename>''' - The file name to read from. | + | * '''<filename>''' - The file name to read from. |
− | * '''<bytepos>''' - The starting byte position | + | * '''<bytepos>''' - The starting byte position. |
* '''<numbytes>''' - The length (bytes) to be read. | * '''<numbytes>''' - The length (bytes) to be read. | ||
− | * '''<&bvar>''' - The binary variable to store the data in | + | * '''<&bvar>''' - The binary variable to store the data in. |
== Example == | == Example == | ||
− | < | + | <syntaxhighlight lang="mIRC">;noop $copyExample(FileA,FileB) |
alias copyExample { | alias copyExample { | ||
;Read the whole file into a binary variable | ;Read the whole file into a binary variable | ||
Line 25: | Line 23: | ||
;Write the bytes form the binary variable to a file | ;Write the bytes form the binary variable to a file | ||
bwrite $qt($2) 0 -1 &tempFile | bwrite $qt($2) 0 -1 &tempFile | ||
− | }</ | + | }</syntaxhighlight> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == | ||
{{mIRC compatibility|5.3}} | {{mIRC compatibility|5.3}} | ||
+ | |||
== See also == | == See also == | ||
+ | * [[List of commands - mIRC|List of commands]] | ||
+ | * [[List of identifiers - mIRC|List of identifiers]] | ||
* {{mIRC|$file}} | * {{mIRC|$file}} | ||
− | |||
− | |||
* {{mIRC|/bset}} | * {{mIRC|/bset}} | ||
− | |||
* {{mIRC|/bunset}} | * {{mIRC|/bunset}} | ||
* {{mIRC|/bwrite}} | * {{mIRC|/bwrite}} | ||
+ | * {{mIRC|/bcopy}} | ||
+ | * {{mIRC|/breplace}} | ||
* {{mIRC|$bvar}} | * {{mIRC|$bvar}} | ||
* {{mIRC|$bfind}} | * {{mIRC|$bfind}} | ||
+ | |||
+ | {{mIRC command list}} | ||
+ | |||
+ | [[Category:MIRC commands]] |