34 #ifndef _QORE_QOREDIR_H
36 #define _QORE_QOREDIR_H
42 #ifndef HAVE_DIRENT_D_TYPE
44 #include <sys/types.h>
118 DLLEXPORT
int chdir(
const char* dir);
149 DLLEXPORT
int chown(uid_t uid, gid_t gid,
ExceptionSink* xsink)
const;
182 DLLEXPORT std::string
getPath(
const char* sub)
const;
230 class qore_qd_private *priv;
DLLEXPORT const QoreEncoding * QCS_DEFAULT
the default encoding for the Qore library
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
provides controlled access to the filesystem through directories
Definition: QoreDir.h:52
DLLEXPORT int mkdir(ExceptionSink *xsink, const char *subdir, int mode=0777) const
creates a subdirectory of the current directory
DLLEXPORT QoreHashNode * statvfs(ExceptionSink *xsink) const
returns a QoreHashNode with filesystem status information
DLLEXPORT QoreStringNode * dirname() const
returns the current directory name or 0 if none is set
DLLEXPORT const QoreEncoding * getEncoding() const
returns the encoding used for the filesystem
DLLEXPORT int chmod(int mode, ExceptionSink *xsink) const
changes the mode of the current directory
DLLEXPORT QoreFile openFile(ExceptionSink *xsink, const char *fn, int flags=O_RDONLY, int mode=0777, const QoreEncoding *cs=QCS_DEFAULT)
returns a new file in this directory
static DLLEXPORT bool folder_exists(const QoreString &folderPath, ExceptionSink &xsink, const QoreEncoding *cs=QCS_DEFAULT)
checks whether folder exists
DLLEXPORT int create(int mode, ExceptionSink *xsink) const
creates the current directory, including all parent directories, if they do not exist
DLLEXPORT QoreDir(ExceptionSink *xsink, const QoreEncoding *cs=QCS_DEFAULT, const char *dir=nullptr)
creates the object and sets the default encoding
static DLLEXPORT bool file_exists(const QoreString &filePath)
checks whether file exists
DLLEXPORT QoreListNode * list(ExceptionSink *xsink, int stat_filter, const QoreString *regex=nullptr, int regex_options=0, bool full=false) const
returns a list of files in the current directory, taking an option regular expression filter
DLLEXPORT int checkPath() const
returns 0 = OK (path exists), non-zero = errno returned by opendir()
DLLEXPORT int rmdir(const char *subdir, ExceptionSink *xsink) const
removes a subdirectory of the current directory
DLLEXPORT std::string getPath(const char *sub) const
returns a complete path with the argument appended to the current directory name
DLLEXPORT ~QoreDir()
closes the directory and frees all memory allocated to the object
DLLEXPORT int chdir(const char *dir, ExceptionSink *xsink)
changes the directory in relation to the current
DLLEXPORT QoreHashNode * hstat(ExceptionSink *xsink) const
returns a QoreHashNode with directory status information
DLLEXPORT QoreListNode * stat(ExceptionSink *xsink) const
returns a QoreListNode with directory status information
static DLLEXPORT QoreListNode * get_files(const QoreString &path, ExceptionSink &xsink, QoreString *regex=nullptr, const QoreEncoding *cs=QCS_DEFAULT)
look up files
static DLLEXPORT std::string get_file_content(const QoreString &fullPath)
reads file content
defines string encoding functions in Qore
Definition: QoreEncoding.h:83
provides controlled access to file data through Qore data structures
Definition: QoreFile.h:66
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition: QoreHashNode.h:50
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
Qore's string value type, reference counted, dynamically-allocated only.
Definition: QoreStringNode.h:50