Re: rename() a directory over a symlink

From: Arnd Bergmann
Date: Tue Aug 04 2009 - 08:46:46 EST


On Tuesday 04 August 2009, you wrote:
> Is there a reason why it's not allowed? Would it be difficult to
> implement it? Seems like it shouldn't be much different from renaming a
> file over a symlink.

It's in the standard we are following,
http://www.opengroup.org/onlinepubs/009695399/functions/rename.html:

"If the old argument points to the pathname of a directory, the new argument shall
not point to the pathname of a file that is not a directory."

http://www.opengroup.org/onlinepubs/009695399/utilities/mv.html:

"In the second synopsis form, mv shall move each file named by a source_file
operand to a destination file in the existing directory named by the target_dir
operand, or referenced if target_dir is a symbolic link referring to an existing
directory. The destination path for each source_file shall be the concatenation
of the target directory, a single slash character, and the last pathname
component of the source_file. This second form is assumed when the final operand
names an existing directory."

Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/