rename(1) rename(1)
NAME
rename - change the name of a file
SYNOPSIS
rename old new
DESCRIPTION
rename renames a file. old is the pathname of the file or
directory to be renamed. new is the new pathname of the file
or directory. Both old and new must be of the same type
(either both files, or both directories) and must reside on
the same file system.
If new already exists, it is removed. Thus, if new names an
existing directory, the directory must not have any entries
other than, possibly, ``.'' and ``..''. When renaming
directories, the new pathname must not name a descendant of
old. The implementation of rename ensures that upon
successful completion a link named new will always exist.
If the final component of old is a symbolic link, the symbolic
link is renamed, not the file or directory to which it points.
Write permission is required for both the directory containing
old and the directory containing new.
NOTES
The system can deadlock if there is a loop in the file system
graph. Such a loop takes the form of an entry in directory a,
say a/foo, being a hard link to directory b, and an entry in
directory b, say b/bar, being a hard link to directory a.
When such a loop exists and two separate processes attempt to
perform rename a/foo b/bar and rename b/bar a/foo,
respectively, the system may deadlock attempting to lock both
directories for modification. The system administrator should
replace hard links to directories by symbolic links.
REFERENCES
link(2), rename(2), unlink(2)
Copyright 1994 Novell, Inc. Page 1