windows#

常用的 Windows 路径实用程序。

函数#

win_path_ok(path)

win_path_double_escape(path)

win_path_backout(path)

_path_to(→ str | tuple[str, Ellipsis] | None)

win_path_to_unix(→ str | tuple[str, Ellipsis] | None)

将 Windows 路径转换为 Unix 路径。

unix_path_to_win(→ str | tuple[str, Ellipsis] | None)

将 Unix 路径转换为 Windows 路径。

win_path_ok(path)#
win_path_double_escape(path)#
win_path_backout(path)#
_path_to(paths: conda.common.path.PathType | conda.common.path.PathsType | None, prefix: conda.common.path.PathType | None = None, *, cygdrive: bool, to_unix: bool) str | tuple[str, Ellipsis] | None#
win_path_to_unix(paths: conda.common.path.PathType | conda.common.path.PathsType | None, prefix: conda.common.path.PathType | None = None, *, cygdrive: bool = False) str | tuple[str, Ellipsis] | None#

将 Windows 路径转换为 Unix 路径。

注意

在 Unix 上运行时会产生意外结果。

参数:
  • paths -- 要转换的路径。

  • prefix -- 用于转换的前缀目录(Windows 路径样式)。如果未提供,则不会进行前缀路径检查。

  • cygdrive -- 是否使用 Cygwin 风格的驱动器前缀。

unix_path_to_win(paths: conda.common.path.PathType | conda.common.path.PathsType | None, prefix: conda.common.path.PathType | None = None, *, cygdrive: bool = False) str | tuple[str, Ellipsis] | None#

将 Unix 路径转换为 Windows 路径。

注意

在 Unix 上运行时会产生意外结果。

参数:
  • paths -- 要转换的路径。

  • prefix -- 用于转换的前缀目录(Windows 路径样式)。如果未提供,则不会进行前缀路径检查。

  • cygdrive -- 未使用。 存在是为了保持签名与 win_path_to_unix 一致。