ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc.. Fossies Dox: ucommon-7.0.0.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file. 28 #ifndef _UCOMMON_FSYS_H_ 29 #define _UCOMMON_FSYS_H_ 31 #ifndef _UCOMMON_CONFIG_H_ 35 #ifndef _UCOMMON_PROTOCOLS_H_ 39 #ifndef _UCOMMON_THREAD_H_ 43 #ifndef _UCOMMON_TYPEREF_H_ 47 #ifndef _UCOMMON_MEMORY_H_ 67 #define __S_ISTYPE(mode, mask) (((mode) & S_IFMT) == (mask)) 70 #if !defined(S_ISDIR) && defined(S_IFDIR) 71 #define S_ISDIR(mode) __S_ISTYPE((mode), S_IFDIR) 74 #if !defined(S_ISCHR) && defined(S_IFCHR) 75 #define S_ISCHR(mode) __S_ISTYPE((mode), S_IFCHR) 76 #elif !defined(S_ISCHR) 77 #define S_ISCHR(mode) 0 80 #if !defined(S_ISBLK) && defined(S_IFBLK) 81 #define S_ISBLK(mode) __S_ISTYPE((mode), S_IFBLK) 82 #elif !defined(S_ISBLK) 83 #define S_ISBLK(mode) 0 86 #if !defined(S_ISREG) && defined(S_IFREG) 87 #define S_ISREG(mode) __S_ISTYPE((mode), S_IFREG) 88 #elif !defined(S_ISREG) 89 #define S_ISREG(mode) 1 92 #if !defined(S_ISSOCK) && defined(S_IFSOCK) 93 #define S_ISSOCK(mode) __S_ISTYPE((mode), S_IFSOCK) 94 #elif !defined(S_ISSOCK) 95 #define S_ISSOCK(mode) (0) 98 #if !defined(S_ISFIFO) && defined(S_IFIFO) 99 #define S_ISFIFO(mode) __S_ISTYPE((mode), S_IFIFO) 100 #elif !defined(S_ISFIFO) 101 #define S_ISFIFO(mode) (0) 104 #if !defined(S_ISLNK) && defined(S_IFLNK) 105 #define S_ISLNK(mode) __S_ISTYPE((mode), S_IFLNK) 106 #elif !defined(S_ISLNK) 107 #define S_ISLNK(mode) (0) 136 OWNER_READONLY = 0400,
137 GROUP_READONLY = 0440,
138 PUBLIC_READONLY = 0444,
139 OWNER_PRIVATE = 0600,
141 GROUP_PRIVATE = 0660,
144 DIR_TEMPORARY = 01777
150 static int remapError(
void);
212 fsys(
const char *path,
unsigned permission,
access_t access);
246 inline operator bool()
const {
262 fsys& operator=(
const fsys& descriptor);
289 void set(
fd_t descriptor);
302 int seek(offset_t offset);
309 int drop(offset_t size = 0);
315 bool is_tty(
void)
const;
321 static bool is_tty(
fd_t fd);
329 ssize_t read(
void *
buffer,
size_t count);
337 ssize_t write(
const void *
buffer,
size_t count);
352 int trunc(offset_t offset);
365 static int prefix(
const char *path);
373 static int prefix(
char *path,
size_t size);
383 static int info(
const char *path, fileinfo_t *
buffer);
390 static int erase(
const char *path);
399 static int copy(
const char *source,
const char *target,
size_t size = 1024);
407 static int rename(
const char *oldpath,
const char *newpath);
415 static int mode(
const char *path,
unsigned value);
450 static bool is_file(
const char *path);
457 static bool is_dir(
const char *path);
464 static bool is_link(
const char *path);
478 static bool is_hidden(
const char *path);
485 void open(
const char *path, access_t access);
503 object.fd = descriptor;
512 void open(
const char *path,
unsigned mode, access_t access);
521 static int unlink(
const char *path);
529 static int link(
const char *path,
const char *target);
537 static int hardlink(
const char *path,
const char *target);
545 static int linkinfo(
const char *path,
char *
buffer,
size_t size);
557 inline int err(
void)
const {
580 static fd_t append(
const char *path);
586 static void release(
fd_t descriptor);
605 static int inherit(
fd_t& descriptor,
bool enable);
611 static fd_t null(void);
618 static int load(
const char *path);
627 static int exec(
const char *path,
char **argv,
char **envp = NULL);
629 static inline bool is_file(
struct stat *inode) {
630 return S_ISREG(inode->st_mode);
633 static inline bool is_dir(
struct stat *inode) {
634 return S_ISDIR(inode->st_mode);
637 static inline bool is_link(
struct stat *inode) {
638 return S_ISLNK(inode->st_mode);
641 static inline bool is_dev(
struct stat *inode) {
645 static inline bool is_char(
struct stat *inode) {
646 return S_ISCHR(inode->st_mode);
649 static inline bool is_disk(
struct stat *inode) {
650 return S_ISBLK(inode->st_mode);
653 static inline bool is_sys(
struct stat *inode) {
678 typedef int (FAR WINAPI *
addr_t)();
692 dso(
const char *path);
703 void map(
const char *path);
716 addr_t find(
const char *symbol)
const;
718 inline int err(
void)
const {
730 inline operator bool()
const {
747 WIN32_FIND_DATA *ptr;
758 dir(
const char *path);
776 static int create(
const char *path,
unsigned mode);
783 static int remove(
const char *path);
789 void open(
const char *path);
797 ssize_t read(
char *
buffer,
size_t count);
804 inline int err(
void)
const {
816 inline operator bool()
const {
static bool is_readable(const char *path)
static void assign(fsys &object, fd_t descriptor)
static bool is_link(const char *path)
bool is_exists(const char *path)
static shell::stringopt error('e', "--error", _TEXT("stderr path to use"), "filename")
static bool is_dev(struct stat *inode)
static int remapError(void)
bool is_dir(const char *path)
static bool is_dir(struct stat *inode)
__EXPORT AppLog & info(AppLog &sl)
bool is_readable(const char *path)
static bool is_sys(struct stat *inode)
static bool is_device(const char *path)
static shell::stringopt input('i', "--input", _TEXT("stdin path to use"), "filename")
void assign(fd_t descriptor)
static bool is_exists(const char *path)
static bool is_disk(struct stat *inode)
bool is_device(const char *path)
bool is_executable(const char *path)
bool is_file(const char *path)
static bool is_dir(const char *path)
static uint8_t buffer[65536]
static bool is_writable(const char *path)
static bool is_link(struct stat *inode)
bool is_writable(const char *path)
static const offset_t end
static bool is_executable(const char *path)
static bool is_file(struct stat *inode)
addr_t operator()(const char *symbol) const
static bool is_file(const char *path)
addr_t operator[](const char *symbol) const
bool is_link(const char *path)
static bool is_char(struct stat *inode)