WindowsPath extension type

A Windows Path. Path is for handling file paths in a type-safe manner. This type supports a number of operations for inspecting a path, including breaking the path into its components, extracting the file name, determining whether the path is absolute, and so on.

on
Implemented types

Constructors

WindowsPath(String _string)
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

ancestors() → Iterable<WindowsPath>
Produces an iterator over Path and its ancestors. e.g. with UnixPath, /a/b/c will produce /a/b/c, /a/b, /a, and /.
asString() → String
canonicalize() → WindowsPath
Returns the canonical, absolute form of the path with all intermediate components normalized.
components() → Iterable<Component>
Produces an iterator over the Components of the path.
endsWith(WindowsPath other) → bool
Determines whether other is a suffix of this.
exists() → Future<bool>
Determines whether file exists on disk.
existsSync() → bool
Determines whether file exists on disk.
extension() → String
Extracts the extension (without the leading dot) of self.file_name, if possible.
fileName() → String
Returns the final component of the Path, if there is one.
filePrefix() → String?
Extracts the portion of the file name before the first "." -
filePrefixOpt() → Option<String>
Extracts the portion of the file name before the first "." -
fileStem() → String?
Extracts the portion of the file name before the last "." -
fileStemOpt() → Option<String>
Extracts the portion of the file name before the last "." -
hasRoot() → bool
Returns true if the Path has a root.
isAbsolute() → bool
Returns true if the Path is absolute, i.e., if it is independent of the current directory.
isDir() → Future<bool>
Returns true if the path exists on disk and is pointing at a directory. Does not follow links.
isDirSync() → bool
Returns true if the path exists on disk and is pointing at a directory. Does not follow links.
isFile() → Future<bool>
Returns true if the path exists on disk and is pointing at a regular file. Does not follow links.
isFileSync() → bool
Returns true if the path exists on disk and is pointing at a regular file. Does not follow links.
isRelative() → bool
Returns true if the Path is relative, i.e., not absolute.
Returns true if the path exists on disk and is pointing at a symlink. Does not follow links.
isSymlinkSync() → bool
iter() → Iter<String>
Produces an iterator over the path’s components viewed as Strings
join(WindowsPath other) → WindowsPath
Creates an Path with path adjoined to this.
metadata() → FutureResult<Metadata, IoError>
Queries the file system to get information about a file, directory, etc. Note: using this method means that the program can no longer compile for the web.
metadataSync() → Result<Metadata, IoError>
Queries the file system to get information about a file, directory, etc. Note: using this method means that the program can no longer compile for the web.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parent() → WindowsPath?
parentOpt() → Option<WindowsPath>
Returns the Path without its final component, if there is one. This means it returns Some("")/"" for relative paths with one component. Returns None/null if the path terminates in a root or prefix, or if it’s the empty string.
readDir() → Future<Result<ReadDir, IoError>>
Returns an iterator over the entries within a directory. Note: using this method results in the program no longer being able to compile to web.
readDirSync() → Result<ReadDir, IoError>
Returns an iterator over the entries within a directory. Note: using this method results in the program no longer being able to compile to web.
Reads a symbolic link, returning the file that the link points to.
readLinkSync() → Result<WindowsPath, IoError>
Reads a symbolic link, returning the file that the link points to.
startsWith(WindowsPath other) → bool
stripPrefix(WindowsPath prefix) → WindowsPath?
Returns a path that, when joined onto base, yields this. Returns None/null if prefix is not a subpath of base.
stripPrefixOpt(WindowsPath prefix) → Option<WindowsPath>
Returns a path that, when joined onto base, yields this. Returns None/null if prefix is not a subpath of base.
symlinkMetadata() → FutureResult<Metadata, IoError>
Returns the metadata for the symlink. Note: using this method means that the program can no longer compile for the web.
symlinkMetadataSync() → Result<Metadata, IoError>
Returns the metadata for the symlink. Note: using this method means that the program can no longer compile for the web.
toString() → String
A string representation of this object.
inherited
withExtension(String extension) → WindowsPath
Creates an Path like this but with the given extension.
withFileName(String fileName) → WindowsPath
Creates an PathBuf like this but with the given file name.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

separator → const String