blob: fda6c6eca771e326bf62b0a9e3457f12af592235 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstrad59c3892019-11-28 20:53:39 +01002 int rename(string from, string to)
MG Mud User88f12472016-06-24 23:31:02 +02003
Zesstra715ec202025-07-09 22:18:31 +02004DESCRIPTION
MG Mud User88f12472016-06-24 23:31:02 +02005
Zesstra715ec202025-07-09 22:18:31 +02006 The efun rename() will move from to the new name to. If from
7 is a file, then to may be either a file or a directory. If
8 from is a directory, then to has to be a directory. If to
9 exists and is a directory, then from will be placed in that
10 directory and keep its original name.
MG Mud User88f12472016-06-24 23:31:02 +020011
Zesstra715ec202025-07-09 22:18:31 +020012 You must have write permission for from to rename the file.
MG Mud User88f12472016-06-24 23:31:02 +020013
Zesstra715ec202025-07-09 22:18:31 +020014 It is only possible to change name of a directory within a
15 directory on machines running System V, i.e. it is not
16 possible to move to another directory. It is not possible to
17 move a directory across filesystems on any system.
MG Mud User88f12472016-06-24 23:31:02 +020018
Zesstra715ec202025-07-09 22:18:31 +020019 On successfull completion rename() will return 0. If any error
20 occurs, a non-zero value is returned.
21
22EXAMPLES
MG Mud User88f12472016-06-24 23:31:02 +020023 rename("/players/wizard/obj.c", "/players/wizard/newobj.c");
24
Zesstra715ec202025-07-09 22:18:31 +020025SEE ALSO
MG Mud User88f12472016-06-24 23:31:02 +020026 copy_file(E), mkdir(E), rmdir(E), rm(E)