1LFC_DELFILESBYPATTERN(3)     LFC Library Functions    LFC_DELFILESBYPATTERN(3)
2
3
4

NAME

6       lfc_delfilesbypattern  -  delete  the  file entries selected by pattern
7       matching on basename
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "lfc_api.h"
12
13       int lfc_delfilesbypattern (const char *path, const char  *pattern,  int
14       force, int *nbstatuses, struct lfc_filestatus **statuses)
15

DESCRIPTION

17       lfc_delfilesbypattern  deletes  the  file  entries  selected by pattern
18       matching on basename. If replicas exist and the force argument  is  not
19       zero, all replicas are first removed.
20
21       path   specifies  the  logical  pathname  relative  to  the current LFC
22              directory or the full LFC pathname.
23
24       pattern
25              allows to restrict the list of files to be  deleted  to  entries
26              having  the basename starting with this pattern.  pattern should
27              be terminated by a %.
28
29       nbstatuses
30              will be set to the number of replies in the array of statuses.
31
32       statuses
33              will be set to the address of an array of lfc_filestatus  struc‐
34              tures  allocated by the API. The client application is responsi‐
35              ble for freeing the array when not needed anymore.
36
37       struct lfc_filestatus {
38            char      name[CA_MAXNAMELEN+1];
39            int       errcode;
40       };
41

RETURN VALUE

43       This routine returns 0 if the operation was successful  or  -1  if  the
44       operation failed. In the latter case, serrno is set appropriately.
45

ERRORS

47       ENOENT       The named directory does not exist.
48
49       EACCES       Search  permission  is  denied  on a component of the path
50                    prefix or write permission is denied on the parent  direc‐
51                    tory or the parent has the sticky bit S_ISVTX set and
52
53                      the  effective  user  ID of the requestor does not match
54                      the owner ID of the file and
55
56                      the effective user ID of the requestor  does  not  match
57                      the owner ID of the directory and
58
59                      the file is not writable by the requestor and
60
61                      the  requestor does not have ADMIN privilege in the Cupv
62                      database.
63
64       ENOMEM       Memory could not be allocated for marshalling the  request
65                    or unmarshalling the reply.
66
67       EFAULT       path, pattern, nbstatuses or statuses is a NULL pointer.
68
69       EEXIST       File has replicas and force is zero.
70
71       ENOTDIR      A component of path prefix is not a directory.
72
73       ENAMETOOLONG The  length of path exceeds CA_MAXPATHLEN or the length of
74                    a path component exceeds CA_MAXNAMELEN.
75
76       EINVAL       The length of pattern exceeds CA_MAXNAMELEN.
77
78       SENOSSERV    Service unknown.
79
80       SEINTERNAL   Database error.
81
82       SECOMERR     Communication error.
83
84       ENSNACT      Name server is not running or is being shutdown.
85

SEE ALSO

87       Castor_limits(4), lfc_delreplica(3), lfc_unlink(3)
88

AUTHOR

90       LCG Grid Deployment Team
91
92
93
94LFC                      $Date: 2007/12/13 11:59:47 $ LFC_DELFILESBYPATTERN(3)
Impressum