blob: 685fd03a3fea7c4cb4c6ad901b64099348735796 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 int copy_file(string from, string to)
3
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
5 The efun copy_file() will copy the file <from> to the new name <to>.
6 If <to> exists and is a directory, then <from> will be placed in that
7 directory and keep its original name.
MG Mud User88f12472016-06-24 23:31:02 +02008
Zesstra715ec202025-07-09 22:18:31 +02009 You must have read permission for <from> and write permission for
10 the target file to copy the file.
Zesstrad59c3892019-11-28 20:53:39 +010011
Zesstra715ec202025-07-09 22:18:31 +020012 On successfull completion copy_file() will return 0. If any error
13 occurs, a non-zero value is returned.
Zesstrad59c3892019-11-28 20:53:39 +010014
Zesstra715ec202025-07-09 22:18:31 +020015EXAMPLES
MG Mud User88f12472016-06-24 23:31:02 +020016 copy_file("/players/wizard/obj.c", "/players/wizard/newobj.c");
17
Zesstra715ec202025-07-09 22:18:31 +020018HISTORY
19 LDMud 3.2.9 restricted the error behaviour to returning non-0.
Zesstrad59c3892019-11-28 20:53:39 +010020
Zesstra715ec202025-07-09 22:18:31 +020021SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020022 mkdir(E), rmdir(E), rm(E), rename(E)