1LFC_DELFILESBYPATTERN(3) LFC Library Functions
2LFC_DELFILESBYPATTERN(3)
3
4
5
6[1mNAME[0m
7 lfc_delfilesbypattern ‐ delete the file entries se‐
8lected by pattern
9 matching on basename
10
11[1mSYNOPSIS[0m
12 [1m#include <sys/types.h>[0m
13 [1m#include "lfc_api.h"[0m
14
15 [1mint lfc_delfilesbypattern (const char
16*[4m[22mpath[24m[1m, const char *[4m[22mpattern[24m[1m, int[0m
17 [4mforce[24m[1m, int *[4m[22mnbstatuses[24m[1m, struct
18lfc_filestatus **[4m[22mstatuses[24m[1m)[0m
19
20[1mDESCRIPTION[0m
21 [1mlfc_delfilesbypattern [22mdeletes the file entries
22selected by pattern
23 matching on basename. If replicas exist and the force ar‐
24gument is not
25 zero, all replicas are first removed.
26
27 [4mpath[24m specifies the logical pathname relative
28to the current LFC
29 directory or the full LFC pathname.
30
31 [4mpattern[0m
32 allows to restrict the list of files to be deleted
33to entries
34 having the basename starting with this pattern.
35[4mpattern[24m should
36 be terminated by a %.
37
38 [4mnbstatuses[0m
39 will be set to the number of replies in the array
40of statuses.
41
42 [4mstatuses[0m
43 will be set to the address of an array of
44lfc_filestatus struc‐
45 tures allocated by the API. The client application
46is responsi‐
47 ble for freeing the array when not needed anymore.
48
49 struct lfc_filestatus {
50 char name[CA_MAXNAMELEN+1];
51 int errcode;
52 };
53
54[1mRETURN VALUE[0m
55 This routine returns 0 if the operation was successful or
56‐1 if the
57 operation failed. In the latter case, [1mserrno [22mis set
58appropriately.
59
60[1mERRORS[0m
61 [1mENOENT [22mThe named directory does not exist.
62
63 [1mEACCES [22mSearch permission is denied on a
64component of the [4mpath[0m
65 prefix or write permission is denied on the
66parent direc‐
67 tory or the parent has the sticky bit S_ISVTX
68set and
69
70 the effective user ID of the requestor
71does not match
72 the owner ID of the file and
73
74 the effective user ID of the requestor
75does not match
76 the owner ID of the directory and
77
78 the file is not writable by the requestor
79and
80
81 the requestor does not have ADMIN privi‐
82lege in the Cupv
83 database.
84
85 [1mENOMEM [22mMemory could not be allocated for mar‐
86shalling the request
87 or unmarshalling the reply.
88
89 [1mEFAULT [4m[22mpath[24m, [4mpattern[24m, [4mnbsta‐
90tuses[24m or [4mstatuses[24m is a NULL pointer.
91
92 [1mEEXIST [22mFile has replicas and [4mforce[24m is
93zero.
94
95 [1mENOTDIR [22mA component of [4mpath[24m prefix is
96not a directory.
97
98 [1mENAMETOOLONG [22mThe length of [4mpath[24m exceeds
99[1mCA_MAXPATHLEN [22mor the length of
100 a [4mpath[24m component exceeds [1mCA_MAX‐
101NAMELEN[22m.
102
103 [1mEINVAL [22mThe length of [4mpattern[24m exceeds
104[1mCA_MAXNAMELEN[22m.
105
106 [1mSENOSSERV [22mService unknown.
107
108 [1mSEINTERNAL [22mDatabase error.
109
110 [1mSECOMERR [22mCommunication error.
111
112 [1mENSNACT [22mName server is not running or is being
113shutdown.
114
115[1mSEE ALSO[0m
116 [1mCastor_limits(4)[22m, [1mlfc_delreplica(3)[22m,
117[1mlfc_unlink(3)[0m
118
119[1mAUTHOR[0m
120 [1mLCG Grid Deployment [22mTeam
121
122
123
124LFC $Date: 2007/12/13 11:59:47 $
125LFC_DELFILESBYPATTERN(3)
126
127
128
129
130
131
132