Returns the contents of an environment variable of name with some special handling
for certain environment variables (like HOME) for platform compatibility.
Similar to
try_from_bstr(), but
panics if malformed surrogates are encountered on windows.
Returns a platform independent home directory.
Similar to
try_into_bstr() but
panics if malformed surrogates are encountered on windows.
return true if path is absolute, which depends on the platform but is always true if it starts with a slash, hence looks like
a linux path.
Resolve relative components virtually without accessing the file system, e.g. turn a/./b/c/.././.. into a,
without keeping intermediate .. and /a/../b/.. becomes /.
If the input path was relative and ends up being the current_dir, . is returned instead of the full path to current_dir.
Like
into_bstr(), but takes
OsStr as input for a lossless, but fallible, conversion.
Like
into_bstr(), but takes
OsString as input for a lossless, but fallible, conversion.
Check each component of path and see if it is a symlink. If so, resolve it.
Do not fail for non-existing components, but assume these are as is.
The same as
realpath(), but allow to configure
max_symlinks to configure how many symbolic links we are going to follow.
This serves to avoid running into cycles or doing unreasonable amounts of work.
Convert paths with slashes to backslashes on windows and do nothing on unix, but panics if malformed surrogates are encountered on windows.
Assures the given bytes use the native path separator.
Replaces windows path separators with slashes, unconditionally.
Replaces windows path separators with slashes, but only do so on windows.
Find backslashes and replace them with slashes, which typically resembles a unix path, unconditionally.
Given input bytes, produce a Path from them ignoring encoding entirely if on unix.
Convert the given path either into its raw bytes on unix or its UTF8 encoded counterpart on windows.