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