blob: a33ea87dc48d49f4e21fdd9b4f5aefb97784ef15 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 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 User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006DESCRIPTION
7 Append the string <str> to the file <file>. Returns 1 for success
8 and 0 if any failure occurred.
MG Mud User88f12472016-06-24 23:31:02 +02009
Zesstra715ec202025-07-09 22:18:31 +020010 If <flags> is 1, the file is removed first; thus making the
11 'append' effectively an 'overwrite'. Default for <flags> is 0.
MG Mud User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 <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.
Zesstrad59c3892019-11-28 20:53:39 +010016
Zesstra715ec202025-07-09 22:18:31 +020017HISTORY
18 LDMud 3.3.523 added the <flags> parameter.
19 LDMud 3.6.0 added the <encoding> parameter.
Zesstrad59c3892019-11-28 20:53:39 +010020
Zesstra715ec202025-07-09 22:18:31 +020021SEE ALSO
Zesstrad59c3892019-11-28 20:53:39 +010022 file_size(E), write_bytes(E), write_file(E), read_file(E),
Zesstra715ec202025-07-09 22:18:31 +020023 read_bytes(E), rm(E), get_dir(E), hooks(C)