blob: 0a3c228e04aaaa6ddb77d825cd0a8dee80389da5 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra715ec202025-07-09 22:18:31 +02002 bytes read_bytes(string file, int start, int number)
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
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 User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 The maximum bytes being read per call is LIMIT_BYTE (see
17 query_limits()).
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019HISTORY
20 LDMud 3.6.5 accepts start offsets before the beginning of the file.
MG Mud User88f12472016-06-24 23:31:02 +020021
Zesstra715ec202025-07-09 22:18:31 +020022SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020023 read_file(E), write_bytes(E), write_file(E)