1DPNS_STAT(3)                DPNS Library Functions                DPNS_STAT(3)
2
3
4

NAME

6       dpns_stat  - get information about a DPNS file or directory in the name
7       server
8

SYNOPSIS

10       #include <sys/types.h>
11       #include "dpns_api.h"
12
13       int dpns_lstat (const char *path, struct dpns_filestat *statbuf)
14
15       int dpns_stat (const char *path, struct dpns_filestat *statbuf)
16
17       int dpns_statx (const char *path,  struct  dpns_fileid  *file_uniqueid,
18       struct dpns_filestat *statbuf)
19

DESCRIPTION

21       dpns_stat  gets  information about a DPNS file or directory in the name
22       server.
23
24       dpns_lstat  is  identical  to  dpns_stat  except  for  symbolic  links.
25       dpns_lstat retrieves information about the link itself, while dpns_stat
26       gets information about the file/directory referenced  by  the  symbolic
27       link.
28
29       dpns_statx  returns  the same information plus the file unique id (name
30       server hostname and file id).  The file can be specified by  path  name
31       or by file_uniqueid.  If both are given, file_uniqueid is used.
32
33       path   specifies  the  logical  pathname  relative  to the current DPNS
34              directory or the full DPNS pathname.
35
36       The structure pointed to by statbuf contains the following members:
37              u_signed64     fileid;        /* entry unique identifier */
38              mode_t         filemode; /* see below */
39              int       nlink;         /* number of files in a directory */
40              uid_t          uid;
41              gid_t          gid;
42              u_signed64     filesize;
43              time_t         atime;         /* last access to file */
44              time_t         mtime;         /* last file modification */
45              time_t         ctime;         /* last metadata modification */
46              short          fileclass;          /*  1-->  experiment,  2  -->
47              user */
48              char      status;        /* '-' --> online, 'm' --> migrated */
49
50       filemode  is  constructed  by  OR'ing  the bits defined in <sys/stat.h>
51       under Unix or  "statbits.h" under Windows/NT:
52
53              S_IFLNK   0xA000          symbolic link
54              S_IFREG   0x8000          regular file
55              S_IFDIR   0x4000          directory
56              S_ISUID   0004000         set user ID on execution
57              S_ISGID   0002000         set group ID on execution
58              S_ISVTX   0001000         sticky bit
59              S_IRUSR   0000400         read by owner
60              S_IWUSR   0000200         write by owner
61              S_IXUSR   0000100         execute/search by owner
62              S_IRGRP   0000040         read by group
63              S_IWGRP   0000020         write by group
64              S_IXGRP   0000010         execute/search by group
65              S_IROTH   0000004         read by others
66              S_IWOTH   0000002         write by others
67              S_IXOTH   0000001         execute/search by others
68

RETURN VALUE

70       This routine returns 0 if the operation was successful  or  -1  if  the
71       operation failed. In the latter case, serrno is set appropriately.
72

ERRORS

74       ENOENT       The named file/directory does not exist or is a null path‐
75                    name.
76
77       EACCES       Search permission is denied on a  component  of  the  path
78                    prefix.
79
80       EFAULT       path or statbuf is a NULL pointer.
81
82       ENOTDIR      A component of path prefix is not a directory.
83
84       ENAMETOOLONG The  length of path exceeds CA_MAXPATHLEN or the length of
85                    a path component exceeds CA_MAXNAMELEN.
86
87       SENOSHOST    Host unknown.
88
89       SENOSSERV    Service unknown.
90
91       SECOMERR     Communication error.
92
93       ENSNACT      Name server is not running or is being shutdown.
94

SEE ALSO

96       Castor_limits(4),    dpns_chdir(3),    dpns_chmod(3),    dpns_chown(3),
97       dpns_creat(3)
98

AUTHOR

100       LCG Grid Deployment Team
101
102
103
104DPNS                     $Date: 2003/09/02 07:08:38 $             DPNS_STAT(3)
Impressum