-- RenameDoc.tioga
-- last edited by: L. Stewart, December 12, 1983 5:21 pm
name Rename:
syntax
Rename newFile ← oldFile
The second argument must be exactly ←, and must be surrounded by spaces.
Rename {-r} target-directory ← list-of-patterns
Rename {-r} list-of-patterns
Rename a group of files to a new directory. The target-directory may be explicit, as in the first case, or will default to the current working directory in the second case.
description
Rename renames files using FS.Rename. If full path names are not used, FS will operate on files in the current working directory.
The pattern '* does not match the characters '/ or '>, but the pattern "**" does. This means that unless you use "**", rename will not rename any files in subdirectories. If the -r switch is set, (and ** is used) then Copy will retain the directory structure of the source. If the -r switch is absent, the shortnames of the source files will be retained, but subdirectory structure will be lost.
Here is description of Rename from FS.mesa.
(To be updated from FSDoc.tioga.)
A missing version part defaults to !H for the "from" name. FS.Rename is the same as FS.Copy followed by FS.Delete, with the performance optimization that in many cases the actual transfer of bits can be skipped. An FS.Error[lock, $lockConflict] occurs if the specified file is currently open. Renaming that implies copying from one server to another is allowed. Renaming (and implied copying or deletion) on global servers occurs synchronously.
examples
% rename bar ← junk.txt
% rename bar.txt ← [ivy]<Stewart>temp>w1aw.txt
% rename /Ivy/Stewart/Temp/Compiler.log ← Compiler.log
% rename /Ivy/Stewart/Notes/Compiler.log ← /Ivy/Stewart/Temp/Compiler.log
% rename /Ivy/Stewart/Temp/*
Move all files in /Ivy/Stewart/Temp/ to the current working directory.
% rename ///Temp/ ← /Ivy/Stewart/Temp/*
Move all files in /Ivy/Stewart/Temp/ to ///Temp/.
warnings
If a pattern does not include a version number specification, then !H is appended.
If a pattern which matches a subtree (files in subdirectories) is used, the subdirectory structure will be lost.
stop/undo
Click the STOP! button
implementation
FSFileCommandsImpl.mesa in CommandTool.df
contact
L. C. Stewart <Stewart.pa>
keyword hints
help button info man
keywords
to be supplied by the Index Czar