Ns rename

From AOLserver Wiki
Revision as of 02:18, 15 June 2004 by WikiSysop (talk | contribs) (imported from WiKit id 630)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/tcl/ns_rename.html


NAME

ns_rename - Rename a file

SYNOPSIS

ns_rename file1 file2

DESCRIPTION

This command renames the file or directory file1 to the file or directory file2. Make sure that file1 exists the directories in which file1 and file2 reside exist, and that they are read/write accessible to the user that is running the AOLserver process. Caution: ns_rename will silently overwrite file2 if it is a file that already exists.
This is a legacy command from when Tcl did not have this functionality. It is now recommended you use Tcl's file rename command instead. In other words, this:
   ns_rename $file1 $file2
is equivalent to:
   file rename -force -- $file1 $file2

EXAMPLES

   # create an empty file called /tmp/ns_rename
   close open /tmp/ns_rename w
   # rename it to /tmp/ns_renamed
   ns_rename /tmp/ns_rename /tmp/ns_renamed
   # check to see if /tmp/ns_renamed exists
   % file exists /tmp/ns_renamed
   1

SEE ALSO

ns_chmod, ns_link, ns_mkdir, ns_rmdir, ns_symlink

Category Documentation - Category Core Tcl API