1LFC_STAT(3) LFC Library Functions LFC_STAT(3)
2
3
4
6 lfc_stat - get information about a LFC file or directory in the name
7 server
8
10 #include <sys/types.h>
11 #include "lfc_api.h"
12
13 int lfc_lstat (const char *path, struct lfc_filestat *statbuf)
14
15 int lfc_stat (const char *path, struct lfc_filestat *statbuf)
16
17 int lfc_statx (const char *path, struct lfc_fileid *file_uniqueid,
18 struct lfc_filestat *statbuf)
19
21 lfc_stat gets information about a LFC file or directory in the name
22 server.
23
24 lfc_lstat is identical to lfc_stat except for symbolic links.
25 lfc_lstat retrieves information about the link itself, while lfc_stat
26 gets information about the file/directory referenced by the symbolic
27 link.
28
29 lfc_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 LFC
34 directory or the full LFC 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
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
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
96 Castor_limits(4), lfc_chdir(3), lfc_chmod(3), lfc_chown(3), lfc_cre‐
97 atg(3)
98
100 LCG Grid Deployment Team
101
102
103
104LFC $Date: 2003/09/02 07:08:38 $ LFC_STAT(3)