The Qt documentation in C++ of this class (QDir) can be read here: http://doc.trolltech.com/4.4/qdir.html
It is useful to access the file system obtaining information about directories or files and using them.
Implemented since KBasic V1.76.
Static Function Create(Path As String) As Boolean
Static Function RecursiveCreate(Path As String) As Boolean
Static Function Remove(Path As String) As Boolean
Static Function RecursiveRemove(Path As String) As Boolean
Static Function FindFile(Path As String, NameFilter As String, Filter As String = “NoFilter”, Sorting As String = “NoSort”) As Strings
Possible values for Filter are
NoFilter | List all. |
Dirs | List directories that match the filters. |
AllDirs | List all directories; i.e. don't apply the filters to directory names. |
Files | List files. |
Drives | List disk drives (ignored under Unix). |
NoSymLinks | Do not list symbolic links (ignored by operating systems that don't support symbolic links). |
NoDotAndDotDot | Do not list the special entries ”.” and ”..”. |
AllEntries | List directories, files, drives and symlinks (this does not list broken symlinks unless you specify System). |
Readable | List files for which the application has read access. The Readable value needs to be combined with Dirs or Files. |
Writable | List files for which the application has write access. The Writable value needs to be combined with Dirs or Files. |
Executable | List files for which the application has execute access. The Executable value needs to be combined with Dirs or Files. |
Modified | Only list files that have been modified (ignored under Unix). |
Hidden | List hidden files (on Unix, files starting with a .). |
System | List system files (on Unix, FIFOs, sockets and device files) |
CaseSensitive | The filter should be case sensitive. |
Possible values for Sorting are
NoSort | |
Name | Sort by name. |
Time | Sort by time (modification time). |
Size | Sort by file size. |
Type | Sort by file type (extension). |
Unsorted | Do not sort. |
DirsFirst | Put the directories first, then the files. |
DirsLast | Put the files first, then the directories. |
Reversed | Reverse the sort order. |
IgnoreCase | Sort case-insensitively. |
LocaleAware | Sort items appropriately using the current locale settings. |
Static Function RecursiveFindFile(Path As String, NameFilter As String, Filter As String = “NoFilter”, Sorting As String = “NoSort”) As Strings
Static Function FindFile(Path As String, NameFilter As Strings, Filter As String = “NoFilter”, Sorting As String = “NoSort”) As Strings
Static Function RecursiveFindFile(Path As String, NameFilter As Strings, Filter As String = “NoFilter”, Sorting As String = “NoSort”) As Strings
Static Function FileList(Path As String) As Strings
Static Function RecursiveFileList(Path As String) As Strings
Static Function Copy(SourcePath As String, DestinationPath As String) As Boolean
Static Function Move(SourcePath As String, DestinationPath As String) As Boolean
Static Function Exists(Path As String) As Boolean
Static Function DateTimeCreatedAsString(Path As String) As String
Static Function DateTimeUpdatedAsString(Path As String) As String
Returns the last modification time of the contents of a file.
Static Function DateTimeReadAsString(Path As String) As String
Returns the last access time of a file.
Static Function Owner(Path As String) As String
Static Function Group(Path As String) As String
Static Function IsReadable(Path As String, Who As String = “User”) As Boolean
Possible values for Who are
Static Function IsWritable(Path As String, Who As String = “User”) As Boolean
Possible values for Who are
Static Function IsExecutable(Path As String, Who As String = “User”) As Boolean
Possible values for Who are
Static Function IsHidden(Path As String) As Boolean
Static Function IsDir(Path As String) As Boolean
Static Function Drives() As Strings
Example print all drive names.
Dim ss As Strings = Dir.Drives For Each s As String In ss Print(s) Next
Static Function TempPath() As String
Static Function HomePath() As String
Example
MsgBox Dir.HomePath()
Static Function RootPath() As String
Static Function WithNativeSeparators(Path As String) As String
Static Function WithoutNativeSeparators(Path As String) As String
Static Function BundleName(Path As String) As String
Only useful on Mac OS X.
Static Function SymLinkTarget(Path As String) As String
Static Function Name(Path As String) As String
Static Function Path (Path As String) As String
Static Function Suffix(Path As String) As String
Static Function IsRoot(Path As String) As Boolean
Static Function IsRelative(Path As String) As Boolean
Static Function IsSymLink(Path As String) As Boolean
Static Function IsBundle(Path As String) As Boolean
Only useful on Mac OS X.