A simple module.
Project description
LogicDaemon-py3-win32-symlink-resolve
resolve_win32_symlink
Resolve Windows symlink targets using the Windows API. Unlike os.readlink(), this can resolve both absolute and relative symlinks correctly on Windows, including those that point to UNC paths.
Installation
pip install LogicDaemon-win32-symlink-resolve
Usage
from pathlib import Path
from resolve_win32_symlink import resolve_symlink
# Returns the target Path if it's a symlink, or None if the path is not a valid IO_REPARSE_TAG_SYMLINK.
target_path: Path | None = resolve_symlink(Path(r'C:\path\to\symlink'))
if target_path:
print(f"Symlink points to: {target_path}")
Important Notes and Limitations
- Windows Only: This package relies on
ctypesbindings forkernel32.dlland Windows-specificDeviceIoControlcodes. It is exclusively for Windows environments. - Supported Reparse Points: This module specifically resolves symlinks (
IO_REPARSE_TAG_SYMLINK). Other types of reparse points, such as directory junctions (IO_REPARSE_TAG_MOUNT_POINT), are not supported and will resolve to None. - Path Prefixes: Windows symlink targets often use the NT device prefix
\??\in the raw substitution name. To preserve idiomatic paths,resolve_symlinkextracts the cleanerPrintNamewhen available, falling back to the target'sSubstituteNameonly ifPrintNameis empty.
To build and publish to PyPI, you can run the following commands in your terminal:
# Ensure you have the build tool and twine installed
pip install build twine
# Build the distribution packages
python -m build
# Upload to PyPI (this will ask for credentials)
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logicdaemon_win32_symlink_resolve-0.0.1.tar.gz.
File metadata
- Download URL: logicdaemon_win32_symlink_resolve-0.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
285228d25b0555108f6aa89ba1a24dcf1297fdbd1c2d6c8a42a3c21c19c7c0df
|
|
| MD5 |
9b9ae6a47411b491386e05e1297f0ae1
|
|
| BLAKE2b-256 |
c5e93a84aaf8f309a233e2cde4bc71dc36f2a8b7ed47dbaf6a83539265f3aba5
|
File details
Details for the file logicdaemon_win32_symlink_resolve-0.0.1-py3-none-any.whl.
File metadata
- Download URL: logicdaemon_win32_symlink_resolve-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
322952e481bc4ae0a9f5dfe5cfd2b49c05538821965b9490050e4e9c2874ed29
|
|
| MD5 |
617b6bfed2a64388067b657157766848
|
|
| BLAKE2b-256 |
271d6fd0f57c04aa8252eb2c978dc8276f5c1faa060db26c79e508208cd88433
|