Import std.io.dir
std.io.dir
std.io's folders: making and removing them, what's in one, and in the folders in it, the paths in one that a glob pattern matches, and the current and temporary folders. Each call has an Async twin, which libuv's thread pool does while the main thread goes on.
std/io/dir.fb
Types
DirEntry
struct
Public Struct DirEntry
Something in a folder: where it is, where it is from the folder that was listed, which for Entries is its name, and what it is.
-
Where it is.
-
Where it is from the folder that was listed, which for Entries is its name.
-
Whether it's a file, a folder, or a link.
-
Its own name, the last in its path.
-
Whether it's a file.
-
Whether it's a folder.
Dir
struct
Public Struct Dir
A folder's Static Methods.
-
Makes the folder, in one that's there. One that's there already throws an IOError of ALREADY_EXISTS.
-
What Create does, without blocking its thread: a call gives its Task.
-
Makes the folder, and each folder it's in that isn't there yet. One that's there already is fine, and a file where a folder should be throws an IOError of NOT_A_DIRECTORY.
-
What CreateAll does, without blocking its thread: a call gives its Task.
-
Removes the folder, which has to be empty, and gives whether there was one. One with something in it throws an IOError of NOT_EMPTY, and a file one of NOT_A_DIRECTORY.
-
What Remove does, without blocking its thread: a call gives its Task.
-
Removes the folder and everything in it, and gives whether there was one. A link in it is removed, not what it links to, and a file throws an IOError of NOT_A_DIRECTORY.
-
What RemoveAll does, without blocking its thread: a call gives its Task.
-
Whether there's a folder at the
path, or a link to one. One the program can't look at isn't there, as far as it can tell. -
What Exists does, without blocking its thread: a call gives its Task.
-
What's in the folder, in the order of their names' bytes, the same on every OS.
-
What Entries does, without blocking its thread: a call gives its Task.
-
What's in the folder and in each folder in it, all the way down, each folder before what's in it, and each folder's entries in the order of their names' bytes. It doesn't go into links, so a link to a folder above can't make it go round forever. A folder in it that can't be listed throws an IOError naming that folder.
-
What Walk does, without blocking its thread: a call gives its Task.
-
What's in the folder, and in the folders in it, whose path from it matches
pattern, in Walk's order. Thepattern's names go between '/'s, and ''s too by Windows' rules, each matching one name in thepath: '' matches any run of characters in a name, '?' any one character, and[abc],[a-z], and[!abc]one character of or not of those; a name that's just "**" matches any number of folders, none too, and last, everything below, files too, and the folder before it. So ".png" matches the folder's PNGs, and "**/*.png" every PNG in it. A '[' with no ']' after it is just itself, and a pattern with no names matches nothing. Names match exactly, in the same case, on every OS. Only the folders thepatterncan reach into are listed. -
Public Static Async Method GlobAsync(path: Path, pattern: String): DirEntry[] Throws IOErrorstatic method #What Glob does, without blocking its thread: a call gives its Task.
-
The program's current folder, which relative paths are from.
-
Makes the folder the program's current one, for every thread.
-
The OS's folder for temporary files, which TempFile and TempDir make theirs in.
Report an issue with this page or with FutureBlitz on GitHub.