size_t strlcpy(char *dst, const char *src, size_t siz)
Copy src to string dst of size siz.
The <sys/stat.h> header shall define the stat structure.
C int errno
The lvalue errno is used by many functions to return error values.
#define DIRLEN
Maximum length of a directory entry name.
struct Dirent Dirent
Describes an entry inside a Directory.
int closedir(DIR *dirp)
Close a directory stream.
#define DT_REG
This is a regular file.
#define ESUCCESS
Reports a success operation.
#define DT_BLK
This is a block device.
int open(const char *path, int oflag,...)
Open file relative to directory file descriptor.
DIR * opendir(const char *dirname)
Open directory associated with file descriptor.
ssize_t read(int fildes, void *buf, size_t nbyte)
Read from a file.
bool eof
End-of-file reached?
struct dirent * buffer
Input buffer.
Represents a directory entry.
Size count
Number of direct structures in the buffer.
slong Error
Error code defined in Error.h.
unsigned int Size
Any sane size indicator cannot go negative.
#define DT_SOCK
This is a Unix domain socket.
int stat(const char *path, struct stat *buf)
Get file status.
struct DIR DIR
A type representing a directory stream.
Size current
Index of the current dirent.
A type representing a directory stream.
#define DT_DIR
This is a directory.
unsigned char u8
Unsigned 8-bit number.
#define DT_CHR
This is a character device.
int fd
File descriptor returned by opendir().
void * memset(void *dest, int ch, size_t count)
Fill memory with a constant byte.
#define DT_FIFO
This is a named pipe (FIFO).
#define DT_LNK
This is a symbolic link.
Describes an entry inside a Directory.
char * dirname(char *path)
Return the directory portion of a pathname.