MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 2 | bytes read_bytes(string file, int start, int number) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 4 | DESCRIPTION |
| 5 | Reads a given amount of bytes from file. |
| 6 | If <start> is not given or 0, the file is read from the |
| 7 | beginning, else from the <start>th byte on. If <start> is |
| 8 | negative, it is counted from the end of the file. If this |
| 9 | would extend beyond the beginning of the file, it is read |
| 10 | from the beginning. |
| 11 | <number> is the number of bytes to read. 0 or negative values |
| 12 | are possible, but not useful. |
| 13 | If <start> would be beyond the end of the file, 0 is returned |
| 14 | instead of a string. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 15 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 16 | The maximum bytes being read per call is LIMIT_BYTE (see |
| 17 | query_limits()). |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 18 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 19 | HISTORY |
| 20 | LDMud 3.6.5 accepts start offsets before the beginning of the file. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 21 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 22 | SEE ALSO |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 23 | read_file(E), write_bytes(E), write_file(E) |