MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
| 2 | int copy_file(string from, string to) |
| 3 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 4 | DESCRIPTION |
| 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 8 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 9 | You must have read permission for <from> and write permission for |
| 10 | the target file to copy the file. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 11 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 12 | On successfull completion copy_file() will return 0. If any error |
| 13 | occurs, a non-zero value is returned. |
Zesstra | d59c389 | 2019-11-28 20:53:39 +0100 | [diff] [blame] | 14 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 15 | EXAMPLES |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 16 | copy_file("/players/wizard/obj.c", "/players/wizard/newobj.c"); |
| 17 | |
Zesstra | 715ec20 | 2025-07-09 22:18:31 +0200 | [diff] [blame^] | 18 | HISTORY |
| 19 | LDMud 3.2.9 restricted the error behaviour to returning non-0. |
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 |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 22 | mkdir(E), rmdir(E), rm(E), rename(E) |