1LFC_STAT(3) LFC Library Functions
2LFC_STAT(3)
3
4
5
6[1mNAME[0m
7 lfc_stat ‐ get information about a LFC file or directo‐
8ry in the name
9 server
10
11[1mSYNOPSIS[0m
12 [1m#include <sys/types.h>[0m
13 [1m#include "lfc_api.h"[0m
14
15 [1mint lfc_lstat (const char *[4m[22mpath[24m[1m, struct
16lfc_filestat *[4m[22mstatbuf[24m[1m)[0m
17
18 [1mint lfc_stat (const char *[4m[22mpath[24m[1m, struct
19lfc_filestat *[4m[22mstatbuf[24m[1m)[0m
20
21 [1mint lfc_statx (const char *[4m[22mpath[24m[1m,
22struct lfc_fileid *[4m[22mfile_uniqueid[24m[1m,[0m
23 [1mstruct lfc_filestat *[4m[22mstatbuf[24m[1m)[0m
24
25[1mDESCRIPTION[0m
26 [1mlfc_stat [22mgets information about a LFC file or
27directory in the name
28 server.
29
30 [1mlfc_lstat [22mis identical to [1mlfc_stat [22mex‐
31cept for symbolic links.
32 [1mlfc_lstat [22mretrieves information about the link
33itself, while [1mlfc_stat[0m
34 gets information about the file/directory referenced by
35the symbolic
36 link.
37
38 [1mlfc_statx [22mreturns the same information plus the
39file unique id (name
40 server hostname and file id). The file can be specified
41by [4mpath[24m name
42 or by [4mfile_uniqueid[24m. If both are given,
43[4mfile_uniqueid[24m is used.
44
45 [4mpath[24m specifies the logical pathname relative
46to the current LFC
47 directory or the full LFC pathname.
48
49 The structure pointed to by [4mstatbuf[24m contains the
50following members:
51 u_signed64 fileid; /* entry unique iden‐
52tifier */
53 mode_t filemode; /* see below */
54 int nlink; /* number of files in a
55directory */
56 uid_t uid;
57 gid_t gid;
58 u_signed64 filesize;
59 time_t atime; /* last access to
60file */
61 time_t mtime; /* last file modifi‐
62cation */
63 time_t ctime; /* last metadata mod‐
64ification */
65 short fileclass; /* 1‐‐> exper‐
66iment, 2 ‐‐>
67 user */
68 char status; /* ’‐’ ‐‐> online, ’m’ ‐‐>
69migrated */
70
71 filemode is constructed by OR’ing the bits defined in
72<[1msys/stat.h[22m>
73 under Unix or [1m"statbits.h" [22munder Windows/NT:
74
75 [1mS_IFLNK 0xA000 [22msymbolic link
76 [1mS_IFREG 0x8000 [22mregular file
77 [1mS_IFDIR 0x4000 [22mdirectory
78 [1mS_ISUID 0004000 [22mset user ID on ex‐
79ecution
80 [1mS_ISGID 0002000 [22mset group ID on
81execution
82 [1mS_ISVTX 0001000 [22msticky bit
83 [1mS_IRUSR 0000400 [22mread by owner
84 [1mS_IWUSR 0000200 [22mwrite by owner
85 [1mS_IXUSR 0000100 [22mexecute/search by
86owner
87 [1mS_IRGRP 0000040 [22mread by group
88 [1mS_IWGRP 0000020 [22mwrite by group
89 [1mS_IXGRP 0000010 [22mexecute/search by
90group
91 [1mS_IROTH 0000004 [22mread by others
92 [1mS_IWOTH 0000002 [22mwrite by others
93 [1mS_IXOTH 0000001 [22mexecute/search by
94others
95
96[1mRETURN VALUE[0m
97 This routine returns 0 if the operation was successful or
98‐1 if the
99 operation failed. In the latter case, [1mserrno [22mis set
100appropriately.
101
102[1mERRORS[0m
103 [1mENOENT [22mThe named file/directory does not ex‐
104ist or is a null path‐
105 name.
106
107 [1mEACCES [22mSearch permission is denied on a com‐
108ponent of the [4mpath[0m
109 prefix.
110
111 [1mEFAULT [4m[22mpath[24m or [4mstatbuf[24m is a
112NULL pointer.
113
114 [1mENOTDIR [22mA component of [4mpath[24m prefix is
115not a directory.
116
117 [1mENAMETOOLONG [22mThe length of [4mpath[24m exceeds
118[1mCA_MAXPATHLEN [22mor the length of
119 a [4mpath[24m component exceeds [1mCA_MAX‐
120NAMELEN[22m.
121
122 [1mSENOSHOST [22mHost unknown.
123
124 [1mSENOSSERV [22mService unknown.
125
126 [1mSECOMERR [22mCommunication error.
127
128 [1mENSNACT [22mName server is not running or is being
129shutdown.
130
131[1mSEE ALSO[0m
132 [1mCastor_limits(4)[22m, [1mlfc_chdir(3)[22m,
133[1mlfc_chmod(3)[22m, [1mlfc_chown(3)[22m, [1mlfc_cre‐[0m
134 [1matg(3)[0m
135
136[1mAUTHOR[0m
137 [1mLCG Grid Deployment [22mTeam
138
139
140
141LFC $Date: 2003/09/02 07:08:38 $
142LFC_STAT(3)
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198