1RFIO_RENAME(3)                   Rfio      Library      Functions
2RFIO_RENAME(3)
3
4
5
6[1mNAME[0m
7       rfio_rename ‐ rename a file or directory
8
9[1mSYNOPSIS[0m
10       [1m#include <sys/types.h>[0m
11       [1m#include "rfio_api.h"[0m
12
13       [1mint  rfio_rename  (const  char  *[4m[22moldpath[24m[1m,
14const char *[4m[22mnewpath[24m[1m)[0m
15
16[1mDESCRIPTION[0m
17       [1mrfio_rename [22mrenames a file or directory.
18
19       [4moldpath[24m   and   [4mnewpath[24m  must be of the same
20type, i.e. both regular files
21       or both directories.
22
23       If [4mnewpath[24m exists already, it will be  removed  be‐
24fore the  rename  takes
25       place. If [4mnewpath[24m is a directory, it must be empty.
26
27       When  renaming  a  directory, [4mnewpath[24m must not be a
28descendant of [4moldpath[24m,
29       i.e.  [4mnewpath[24m must not contain a path  prefix  that
30names [4moldpath[24m.
31
32       Write  permission  is required on both parents. If [4mold‐
33path[24m  is  a  direc‐
34       tory,  write permission is required on it and  if  [4mnew‐
35path[24m is an existing
36       directory, write permission is also required on it.
37
38       If  any of the parents has the sticky bit S_ISVTX set, ei‐
39ther
40
41              the effective user ID of the requestor  must  match
42the  owner  ID
43              of the file or
44
45              the  effective  user ID of the requestor must match
46the owner ID
47              of the directory or
48
49              the file must be writable by the requestor or
50
51              the requestor must be super‐user.
52
53[1mRETURN VALUE[0m
54       This routine returns 0 if the operation was successful  or
55‐1  if  the
56       operation failed. In the latter case, [1mserrno [22mis set
57appropriately.
58
59[1mERRORS[0m
60       [1mENOENT       [22mA component of  [4moldpath[24m  prefix
61does not exist or [4moldpath[24m or
62                    [4mnewpath[24m is a null pathname.
63
64       [1mEACCES       [22mSearch permission is denied on a  com‐
65ponent  of  the  path
66                    prefixes  or write permission on  the  parent
67directories is
68                    denied  or  [4moldpath[24m is a directory and
69write  permission  is
70                    denied on [4moldpath[24m or [4mnewpath[24m.
71
72       [1mEFAULT       [4m[22moldpath[24m or [4mnewpath[24m is  a
73NULL pointer.
74
75       [1mEEXIST       [4m[22mnewpath[24m is an existing directo‐
76ry and is not empty.
77
78       [1mENOTDIR      [22mA  component  of  the   path  prefixes
79is not a directory or
80                    [4moldpath[24m  is  a  directory  and [4mnew‐
81path[24m is an existing  regular
82                    file.
83
84       [1mEISDIR       [4m[22mnewpath[24m is  a  directory  while
85[4moldpath[24m is a regular file.
86
87       [1mEINVAL        [4m[22mnewpath[24m  is  a  descendant  of
88[4moldpath[24m.
89
90       [1mENAMETOOLONG  [22mThe   length  of  [4moldpath[24m   or
91[4mnewpath[24m exceeds [1mCA_MAXPATHLEN [22mor
92                    the   length  of  a  path  component  exceeds
93[1mCA_MAXNAMELEN[22m.
94
95       [1mSENOSHOST    [22mHost unknown.
96
97       [1mSENOSSERV    [22mService unknown.
98
99       [1mSECOMERR     [22mCommunication error.
100
101       [1mERFXHOST     [22mCross‐host rename is not supported.
102
103[1mSEE ALSO[0m
104       [1mCastor_limits(4)[22m, [1mrfio_chmod(3)[22m, [1mrfio_un‐
105link(3)[0m
106
107[1mAUTHOR[0m
108       [1mLCG Grid Deployment [22mTeam
109
110
111
112LCG                         $Date:    2005/03/31    13:13:03    $
113RFIO_RENAME(3)
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
Impressum