Difference between revisions of "Bwrite"

From Scriptwiki
Jump to: navigation, search
m
 
m
Line 4: Line 4:
 
If the file doesn't exist, it will be created.
 
If the file doesn't exist, it will be created.
 
If the file is smaller then ''S'' bytes, it will be extended with zeros to the ''S''th byte.
 
If the file is smaller then ''S'' bytes, it will be extended with zeros to the ''S''th byte.
 +
 
If ''S'' = -1 the data will be appended to the end of the file.
 
If ''S'' = -1 the data will be appended to the end of the file.
 +
 
If ''N'' = -1 all of the specified data is written to the file.
 
If ''N'' = -1 all of the specified data is written to the file.

Revision as of 18:26, 14 December 2006

The bwrite command is used to write data to a file.

bwrite <filename> <S> [N] <text|%var|&binvar>

This will write N bytes from the specified text / %var / &binvar data to the file, starting at position S. This will overwrite existing data, if any. If the file doesn't exist, it will be created. If the file is smaller then S bytes, it will be extended with zeros to the Sth byte.

If S = -1 the data will be appended to the end of the file.

If N = -1 all of the specified data is written to the file.