logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

VOP_RENAME — rename a file

Authors

       This manual page was written by Doug Rabson.

Debian                                            July 24, 1996                                    VOP_RENAME(9)

Description

       This renames a file and possibly changes its parent directory.  If the destination object exists, it will
       be removed first.

       Its arguments are:

       fdvp  The vnode of the old parent directory.

       fvp   The vnode of the file to be renamed.

       fcnp  Pathname information about the file's current name.

       tdvp  The vnode of the new parent directory.

       tvp   The vnode of the target file (if it exists).

       tcnp  Pathname information about the file's new name.

Errors

       [EPERM]            The file is immutable.

       [EXDEV]            It is not possible to rename a file between different file systems.

       [EINVAL]           An  attempt  was  made to rename . or .., or to perform an operation which would break
                          the directory tree structure.

       [ENOTDIR]          An attempt was made to rename a directory to a file or vice versa.

       [ENOTEMPTY]        An attempt was made to remove a directory which is not empty.

Locks

       The source directory and file are unlocked but are expected to have their ref count bumped on entry.  The
       VOP routine is expected to vrele(9) both prior to returning.

       The destination directory and file are locked as well as having their ref count bumped.  The VOP  routine
       is expected to vput(9) both prior to returning.

Name

       VOP_RENAME — rename a file

See Also

vnode(9)

Synopsis

#include<sys/param.h>#include<sys/vnode.h>intVOP_RENAME(structvnode*fdvp,  structvnode*fvp,  structcomponentname*fcnp, structvnode*tdvp,
           structvnode*tvp, structcomponentname*tcnp);

See Also