Site Tools


rename

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

rename [2007/03/02 02:32] (current)
Line 1: Line 1:
 +#$EPIC: rename.txt,​v 1.4 2007/03/02 02:32:04 jnelson Exp $
 +======Synopsis:​======
 +$__rename__(<​oldpath>​ <​newpath>​)
 +
 +======Technical:​======
 +   * The <​oldpath>​ and <​newpath>​ arguments are [[what is a word|dwords]] which is different than most functions.
 +   * If the <​oldpath>​ or <​newpath>​ arguments are omitted this function returns the empty string.
 +   * The file <​oldpath>​ is renamed to <​newpath>​ in accordance with the rename(2) system call on your operating system.
 +   * Generally speaking $__rename__() cannot move files between file systems, but they can be moved between directories on the same file system.
 +
 +======Practical:​======
 +Naturally, this function is useful any time a file needs to be renamed.
 +One use for it might be to back up your .ircrc before doing a __SAVE__, just
 +in case something goes wrong before the command is completed.
 +
 +======Returns:​======
 +<​file>​
 + ​0 ​  file renamed successfully
 +-1   error during rename attempt
 +</​file>​
 +
 +======Examples:​======
 +<​file>​
 +$rename(~/​.ircrc ~/​.ircrc.bak) ​             returns 0 if successful
 +$rename(/​etc/​passwd /​etc/​hahaha) ​           probably will return -1
 +</​file>​
 +
 +======History:​======
 +This function first appeared in EPIC2.
  
rename.txt ยท Last modified: 2007/03/02 02:32 (external edit)