Go to the documentation of this file.
44 for (
Size i = 0; i < positionals.
count(); i++)
65 if ((
stat(*file, &st)) < 0)
72 printf(
"File: %s\r\n", *file);
78 printf(
"Regular File\r\n");
86 printf(
"Character Device\r\n");
92 printf(
"Block Device\r\n");
#define S_ISBLK(m)
Test for a block special file.
off_t st_size
For regular files, the file size in bytes.
#define S_ISDIR(m)
Test for a directory.
The <sys/stat.h> header shall define the stat structure.
u16 minor
Device specific minor ID number.
C int errno
The lvalue errno is used by many functions to return error values.
uid_t st_uid
User ID of file.
virtual Result exec()
Execute the application.
dev_t st_dev
Device ID of device containing file.
POSIX-compatible application.
const ArgumentContainer & arguments() const
Get program arguments.
void setDescription(const String &desc)
Set program description.
#define S_ISCHR(m)
Test for a character special file.
int printf(const char *format,...)
Output a formatted string to standard output.
virtual Size count() const
Returns the number of items inside the Vector.
char * strerror(int errnum)
The strerror function maps the number in errnum to a message string.
ino_t st_ino
File inode number.
#define S_ISREG(m)
Test for a regular file.
unsigned int Size
Any sane size indicator cannot go negative.
mode_t st_mode
Mode of file.
FileStatus(int argc, char **argv)
Constructor.
ProcessID major
Major device ID number is a PID.
int stat(const char *path, struct stat *buf)
Get file status.
Result registerPositional(const char *name, const char *description, Size count=1)
Register a positional argument.
ArgumentParser & parser()
Get program arguments parser.
#define ERROR(msg)
Output an error message.
gid_t st_gid
Group ID of file.
virtual ~FileStatus()
Destructor.
Result printStatus(const String &file) const
Concatenate a file.
const Vector< Argument * > & getPositionals() const
Get positional arguments.