Qore Programming Language Reference Manual  0.8.12.3
QC_Dir.dox.h
1 namespace Qore {
4 
13 class Dir {
14 
15 public:
17 
34 bool chdir(string path);
35 
36 public:
38 
59 nothing chgrp(int gid);
60 
61 public:
63 
85 nothing chgrp(string groupname);
86 
87 public:
89 
107 nothing chmod(softint mode);
108 
109 public:
111 
132 nothing chown(int uid);
133 
134 public:
136 
158 nothing chown(string username);
159 
160 public:
162 
171  constructor(*string encoding);
172 
173 public:
175 
180  copy();
181 
182 public:
184 
206 int create(softint mode = 0777);
207 
208 public:
210 
218 bool exists();
219 
220 public:
222 
242 hash hstat();
243 
244 public:
246 
268 list list(bool full = False);
269 
270 public:
272 
300 list list(string regex, softint regex_options = 0, softbool full = False);
301 
302 public:
304 
328 list listDirs(bool full = False);
329 
330 public:
332 
360 list listDirs(string regex, softint regex_options = 0, softbool full = False);
361 
362 public:
364 
389 list listFiles(bool full = False);
390 
391 public:
393 
421 list listFiles(string regex, softint regex_options = 0, softbool full = False);
422 
423 public:
425 
444 nothing mkdir(string subdir, softint mode = 0777);
445 
446 public:
448 
460 Dir openDir(string subdir, *string encoding);
461 
462 public:
464 
481 File openFile(string filename, int flags = O_RDONLY, int mode = 0666, *string encoding);
482 
483 public:
485 
494 *string path();
495 
496 public:
498 
520 bool removeFile(string file);
521 
522 public:
524 
544 nothing rmdir(string subdir);
545 
546 public:
548 
568 list stat();
569 
570 public:
572 
593 hash statvfs();
594 };
595 };
list listDirs(bool full=False)
Retrieves all subdirectory entries in this directory, except "." and ".." directories; if any errors ...
nothing rmdir(string subdir)
Removes a direct subdirectory from the Dir object's current path.
This class implements directory handling, file listing, creating/removing subdirectories, etc.
Definition: QC_Dir.dox.h:13
constructor(*string encoding)
Creates the Directory object.
int create(softint mode=0777)
Creates the directory tree the Dir object points to, if it does not exist.
hash statvfs()
Returns a hash of filesystem status values for the current directory.
*string path()
Returns the path of the Dir object or NOTHING if no path is set.
bool removeFile(string file)
Remove the file with the given name in the Dir object's directory.
const False
logical False
Definition: qc_qore.dox.h:92
nothing mkdir(string subdir, softint mode=0777)
Creates a direct subdirectory in the Dir object's current path.
bool regex(string str, string regex, int options=0)
Returns True if the regular expression matches the string passed, otherwise returns False...
bool exists()
Returns True if the path in the Dir object points to a directory that already exists and is openable ...
File openFile(string filename, int flags=O_RDONLY, int mode=0666, *string encoding)
Create and open a File object in the current directory of the Dir object.
nothing chmod(softint mode)
Changes the mode of the directory.
copy()
Creates a new directory object with the same character encoding specification and the same path as th...
nothing chown(int uid)
Change the ownership of the directory from the userid.
list listFiles(bool full=False)
Retrieves all files in this directory; if any errors occur an exception is thrown.
hash hstat()
Returns a hash of file status information for the current directory.
list list(bool full=False)
Get all entries in this directory, except "." and ".." directories; if any errors occur an exception ...
const O_RDONLY
Open the file read-only.
Definition: QC_File.dox.h:875
The File class allows Qore programs to read, write, and create files.
Definition: QC_File.dox.h:50
main Qore-language namespace
Definition: Pseudo_QC_All.dox.h:2
nothing chgrp(int gid)
Change the group membership of the directory from the group id.
list stat()
Returns a list of file status information for the current directory.
bool chdir(string path)
Changes the current directory of the Dir object to the path given.
hash hash(object obj)
Returns a hash of an object's members.
Dir openDir(string subdir, *string encoding)
Get a Dir object as an subdir entry of the current directory.