159 |
if(s->devinfo->f_files > 0) { |
if(s->devinfo->f_files > 0) { |
160 |
|
|
161 |
fprintf(stdout, |
fprintf(stdout, |
162 |
"Device '%s' is accessible\n\t" |
"Device '%s' %s\n\t" |
163 |
"Space: %.1f%% [%.1f MB] Inodes: %.1f%% [%ld objects]\n\t" |
"Space: %.1f%% [%.1f MB] Inodes: %.1f%% [%ld objects]\n\t" |
164 |
"UID: %d GID: %d Permission: %o\n", |
"UID: %d GID: %d Permission: %o\n", |
165 |
s->name, |
s->name, |
166 |
|
(s->perm&&s->perm->has_error)? |
167 |
|
"permission error": |
168 |
|
(s->uid&&s->uid->has_error)? |
169 |
|
"UID error": |
170 |
|
(s->gid&&s->gid->has_error)? |
171 |
|
"GID error": |
172 |
|
"is accessible", |
173 |
(float) 100 * (s->devinfo->f_blocks - |
(float) 100 * (s->devinfo->f_blocks - |
174 |
s->devinfo->f_blocksfreetotal) / |
s->devinfo->f_blocksfreetotal) / |
175 |
s->devinfo->f_blocks, |
s->devinfo->f_blocks, |
183 |
|
|
184 |
} else { |
} else { |
185 |
|
|
186 |
fprintf(stdout, "Device '%s' is accessible\n\t" |
fprintf(stdout, "Device '%s' %s\n\t" |
187 |
"Space: %.1f%% [%.1f MB]\n\t" |
"Space: %.1f%% [%.1f MB]\n\t" |
188 |
"UID: %d GID: %d Permission: %o\n", |
"UID: %d GID: %d Permission: %o\n", |
189 |
s->name, |
s->name, |
190 |
|
(s->perm&&s->perm->has_error)? |
191 |
|
"permission error": |
192 |
|
(s->uid&&s->uid->has_error)? |
193 |
|
"UID error": |
194 |
|
(s->gid&&s->gid->has_error)? |
195 |
|
"GID error": |
196 |
|
"is accessible", |
197 |
(float) 100 * (s->devinfo->f_blocks - |
(float) 100 * (s->devinfo->f_blocks - |
198 |
s->devinfo->f_blocksfreetotal) / s->devinfo->f_blocks, |
s->devinfo->f_blocksfreetotal) / s->devinfo->f_blocks, |
199 |
(float) (s->devinfo->f_blocks - s->devinfo->f_blocksfreetotal) / |
(float) (s->devinfo->f_blocks - s->devinfo->f_blocksfreetotal) / |
211 |
s->name); |
s->name); |
212 |
} else { |
} else { |
213 |
fprintf(stdout, |
fprintf(stdout, |
214 |
"File '%s' exist\n\t" |
"File '%s' %s\n\t" |
215 |
"Size: %luB MB UID: %d GID: %d Permission: %o\n", |
"Size: %luB MB UID: %d GID: %d Permission: %o\n", |
216 |
s->name, |
s->name, |
217 |
|
(s->perm&&s->perm->has_error)? |
218 |
|
"permission error": |
219 |
|
(s->checksum&&s->checksum->has_error)? |
220 |
|
"checksum error": |
221 |
|
(s->uid&&s->uid->has_error)? |
222 |
|
"UID error": |
223 |
|
(s->gid&&s->gid->has_error)? |
224 |
|
"GID error": |
225 |
|
"exist", |
226 |
(unsigned long)stat_buf.st_size/1048576, (int)stat_buf.st_uid, |
(unsigned long)stat_buf.st_size/1048576, (int)stat_buf.st_uid, |
227 |
(int)stat_buf.st_gid, (int)(stat_buf.st_mode & 07777)); |
(int)stat_buf.st_gid, (int)(stat_buf.st_mode & 07777)); |
228 |
} |
} |
233 |
fprintf(stdout, "Directory '%s' doesn't exist\n", s->name); |
fprintf(stdout, "Directory '%s' doesn't exist\n", s->name); |
234 |
} else { |
} else { |
235 |
fprintf(stdout, |
fprintf(stdout, |
236 |
"Directory '%s' exist\n\t" |
"Directory '%s' %s\n\t" |
237 |
"UID: %d GID: %d Permission: %o\n", |
"UID: %d GID: %d Permission: %o\n", |
238 |
s->name, |
s->name, |
239 |
|
(s->perm&&s->perm->has_error)? |
240 |
|
"permission error": |
241 |
|
(s->uid&&s->uid->has_error)? |
242 |
|
"UID error": |
243 |
|
(s->gid&&s->gid->has_error)? |
244 |
|
"GID error": |
245 |
|
"exist", |
246 |
(int)stat_buf.st_uid, (int)stat_buf.st_gid, |
(int)stat_buf.st_uid, (int)stat_buf.st_gid, |
247 |
(int)(stat_buf.st_mode & 07777)); |
(int)(stat_buf.st_mode & 07777)); |
248 |
} |
} |