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

NAME

6       lfc_statg  -  get information about a LFC file or directory in the name
7       server
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "lfc_api.h"
12
13       int lfc_statg (const char *path, const char *guid, struct lfc_filestatg
14       *statbuf)
15
16       int lfc_statr (const char *sfn, struct lfc_filestatg *statbuf)
17

DESCRIPTION

19       lfc_statg  gets  information  about a LFC file or directory, having the
20       given GUID, in the name server.
21
22       lfc_statr retrieves information about the given replica.
23
24       The file can be specified by path name or by guid.  If both are  given,
25       they must point at the same file.
26
27       guid   specifies the Grid Unique IDentifier.
28
29       path   specifies  the  logical  pathname  relative  to  the current LFC
30              directory or the full LFC pathname.
31
32       sfn    is either the Site  URL  or  the  Physical  File  Name  for  the
33              replica.
34
35       The structure pointed to by statbuf contains the following members:
36              u_signed64     fileid;             /* entry unique identifier */
37              char      guid[CA_MAXGUIDLEN+1]    /* GUID */
38              mode_t         filemode;      /* see below */
39              int       nlink;              /*  number of files in a directory
40              */
41              uid_t          uid;
42              gid_t          gid;
43              u_signed64     filesize;
44              time_t         atime;              /* last access to file */
45              time_t         mtime;              /* last file modification */
46              time_t         ctime;              /* last metadata modification
47              */
48              short          fileclass;          /*  1-->  experiment,  2  -->
49              user */
50              char      status;             /*  '-'  -->   online,   'm'   -->
51              migrated */
52              char      csumtype[3];
53              char      csumvalue[33];
54
55       filemode  is  constructed  by  OR'ing  the bits defined in <sys/stat.h>
56       under Unix or  "statbits.h" under Windows/NT:
57
58              S_IFLNK   0xA000          symbolic link
59              S_IFREG   0x8000          regular file
60              S_IFDIR   0x4000          directory
61              S_ISUID   0004000         set user ID on execution
62              S_ISGID   0002000         set group ID on execution
63              S_ISVTX   0001000         sticky bit
64              S_IRUSR   0000400         read by owner
65              S_IWUSR   0000200         write by owner
66              S_IXUSR   0000100         execute/search by owner
67              S_IRGRP   0000040         read by group
68              S_IWGRP   0000020         write by group
69              S_IXGRP   0000010         execute/search by group
70              S_IROTH   0000004         read by others
71              S_IWOTH   0000002         write by others
72              S_IXOTH   0000001         execute/search by others
73

RETURN VALUE

75       This routine returns 0 if the operation was successful  or  -1  if  the
76       operation failed. In the latter case, serrno is set appropriately.
77

ERRORS

79       ENOENT       The named file/directory does not exist or is a null path‐
80                    name.
81
82       EACCES       Search permission is denied on a  component  of  the  path
83                    prefix.
84
85       EFAULT       path or statbuf is a NULL pointer.
86
87       EINVAL       The  length of the guid component exceeds CA_MAXGUIDLEN or
88                    path and guid are both given and they point at a different
89                    file.
90
91       ENOTDIR      A component of path prefix is not a directory.
92
93       ENAMETOOLONG The  length of path exceeds CA_MAXPATHLEN or the length of
94                    a path component exceeds CA_MAXNAMELEN or  the  length  of
95                    the sfn exceeds CA_MAXSFNLEN.
96
97       SENOSHOST    Host unknown.
98
99       SENOSSERV    Service unknown.
100
101       SECOMERR     Communication error.
102
103       ENSNACT      Name server is not running or is being shutdown.
104

SEE ALSO

106       Castor_limits(4),  lfc_chdir(3),  lfc_chmod(3),  lfc_chown(3), lfc_cre‐
107       atg(3)
108

AUTHOR

110       LCG Grid Deployment Team
111
112
113
114LFC                      $Date: 2005/04/28 05:20:20 $             LFC_STATG(3)
Impressum