MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 2 | int write_file(string file, string str) |
| 3 | int write_file(string file, string str, int flags) |
| 4 | int write_file(string file, string str, int flags, string encoding) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 5 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 6 | DESCRIPTION |
| 7 | Append the string <str> to the file <file>. Returns 1 for success |
| 8 | and 0 if any failure occurred. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 9 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 10 | If <flags> is 1, the file is removed first; thus making the |
| 11 | 'append' effectively an 'overwrite'. Default for <flags> is 0. |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 12 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 13 | <encoding> denotes the encoding to be used for saving the string |
| 14 | in the file. If it is not given or 0, the H_FILE_ENCODING driver |
| 15 | hook will be used. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 16 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 17 | HISTORY |
| 18 | LDMud 3.3.523 added the <flags> parameter. |
| 19 | LDMud 3.6.0 added the <encoding> parameter. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 20 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 21 | SEE ALSO |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 22 | file_size(E), write_bytes(E), write_file(E), read_file(E), |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame] | 23 | read_bytes(E), rm(E), get_dir(E), hooks(C) |