View/Edit #1:filemove

Switch to edit mode.

Name(s): filemove
1:  {oldname, dest, ?newname = oldname} = args
2:  if (!this:fileexists(oldname))
3:    raise(E_INVIND, "File not found")
4:    "elseif (dest:file_exists(newname))"
5:    "  raise(E_INVARG, \"File already exists with that name\");"
6:  elseif (!$perm_utils:controls(caller_perms(), this) || !$perm_utils:controls(caller_perms(), dest))
7:    raise(E_PERM)
8:  elseif (dest in this.files_unwritable_by_owner && !caller_perms().wizard)
9:    raise(E_PERM)
10: else
11:   file_rename($file_utils:filespec(this, oldname), $file_utils:filespec(dest, newname))
12: endif
13: "Last modified by Dax (#789) on Sun Jan 11 12:21:09 2004 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]