lfc_rename man page

LFC_RENAME(3)                LFC Library Functions               LFC_RENAME(3)

[1mNAME[0m
      lfc_rename - rename a LFC file or directory in the name server

[1mSYNOPSIS[0m
      [1m#include <sys/types.h>[0m
      [1m#include "lfc_api.h"[0m

      [1mint lfc_rename (const char *[4m[22moldpath[24m[1m, const char *[4m[22mnewpath[24m[1m)[0m

[1mDESCRIPTION[0m
      [1mlfc_rename [22mrenames a LFC file or directory in the name server.

      [4moldpath[24m  and  [4mnewpath[24m must be of the same type, i.e. both regular files
      or both directories.

      If [4mnewpath[24m exists already, it will be removed before the  rename  takes
      place. If [4mnewpath[24m is a directory, it must be empty.

      When renaming a directory, [4mnewpath[24m must not be a descendant of [4moldpath[24m,
      i.e.  [4mnewpath[24m must not contain a path prefix that names [4moldpath[24m.

      Write permission is required on both parents. If [4moldpath[24m  is  a  direc-
      tory,  write permission is required on it and if [4mnewpath[24m is an existing
      directory, write permission is also required on it.

      If any of the parents has the sticky bit S_ISVTX set, either

             the effective user ID of the requestor must match the  owner  ID
             of the file or

             the  effective  user ID of the requestor must match the owner ID
             of the directory or

             the file must be writable by the requestor or

             the requestor must have ADMIN privilege in the Cupv database.

[1mRETURN VALUE[0m
      This routine returns 0 if the operation was successful  or  -1  if  the
      operation failed. In the latter case, [1mserrno [22mis set appropriately.

[1mERRORS[0m
      [1mENOENT       [22mA component of [4moldpath[24m prefix does not exist or [4moldpath[24m or
                   [4mnewpath[24m is a null pathname.

      [1mEACCES       [22mSearch permission is denied on a  component  of  the  path
                   prefixes  or write permission on the parent directories is
                   denied or [4moldpath[24m is a directory and write  permission  is
                   denied on [4moldpath[24m or [4mnewpath[24m.

      [1mEFAULT       [4m[22moldpath[24m or [4mnewpath[24m is a NULL pointer.

      [1mEEXIST       [4m[22mnewpath[24m  is an existing directory and is not empty or [4mnew-[0m
                   [4mpath[24m is an existing file with replicas.

      [1mENOTDIR      [22mA component of the path prefixes is  not  a  directory  or
                   [4moldpath[24m  is a directory and [4mnewpath[24m is an existing regular
                   file.

      [1mEISDIR       [4m[22mnewpath[24m is a directory while [4moldpath[24m is a regular file.

      [1mEINVAL       [4m[22mnewpath[24m is a descendant of [4moldpath[24m.

      [1mENAMETOOLONG [22mThe length of [4moldpath[24m or [4mnewpath[24m exceeds [1mCA_MAXPATHLEN  [22mor
                   the length of a path component exceeds [1mCA_MAXNAMELEN[22m.

      [1mSENOSHOST    [22mHost unknown.

      [1mSENOSSERV    [22mService unknown.

      [1mSECOMERR     [22mCommunication error.

      [1mENSNACT      [22mName server is not running or is being shutdown.

[1mSEE ALSO[0m
      [1mCastor_limits(4)[22m,     [1mlfc_chdir(3)[22m,     [1mlfc_chmod(3)[22m,    [1mlfc_unlink(3)[22m,
      [1mCupvlist(1)[0m

[1mAUTHOR[0m
      [1mLCG Grid Deployment [22mTeam

LFC                      $Date: 2005/06/30 08:34:03 $            LFC_RENAME(3)