this.Path.expandUser
Path expandUser() constExpands a leading tilde in the path to the user's home directory, similar to Python's os.path.expanduser / pathlib.Path.expanduser semantics.
Platform semantics:
- POSIX:
- `~` or `~/...` expands to the current user's home directory (prefers
$HOME). ~useror~user/...expands to the named user's home directory via passwd.
If the user does not exist, the path is returned unchanged.
- Windows:
- `~` or `~\\...` or `~/...` expands to the current user's profile directory.
~useris not supported and the path is returned unchanged (matches Python behavior).
Returns
A new Path with tilde expansion applied; if not applicable, returns