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.
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.
/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(
) → Option< String> - Extracts the portion of the file name before the first "." -
-
fileStem(
) → 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.
-
isSymlink(
) → Future< bool> - 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(
) → Future< Metadata> - 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(
) → Metadata - 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(
) → Option< WindowsPath> -
readDir(
) → Future< Result< ReadDir, PathIoError> > - 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, PathIoError> - 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.
-
readLink(
) → Future< Result< WindowsPath, PathIoError> > - Reads a symbolic link, returning the file that the link points to.
-
readLinkSync(
) → Result< WindowsPath, PathIoError> - Reads a symbolic link, returning the file that the link points to.
-
startsWith(
WindowsPath other) → bool -
stripPrefix(
WindowsPath prefix) → Option< WindowsPath> -
Returns a path that, when joined onto base, yields this. Returns None if
prefix
is not a subpath of base. -
symlinkMetadata(
) → Future< Result< Metadata, PathIoError> > - Returns the metadata for the symlink. Note: using this method means that the program can no longer compile for the web.
-
symlinkMetadataSync(
) → Result< Metadata, PathIoError> - 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
- isIoSupported → const bool
- Returns whether io operations are supported. If false, is currently running on the web.
- separator → const String