PHP 8.0.30
Preview: dylib.py Size: 960 B
/opt/alt/python-internal/lib64/python3.11/ctypes/macholib/dylib.py

"""
Generic dylib path manipulation
"""

import re

__all__ = ['dylib_info']

DYLIB_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
""")

def dylib_info(filename):
    """
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    """
    is_dylib = DYLIB_RE.match(filename)
    if not is_dylib:
        return None
    return is_dylib.groupdict()

Directory Contents

Dirs: 1 × Files: 6

Name Size Perms Modified Actions
- drwxr-xr-x 2026-07-22 02:19:45
Edit Download
4.91 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
960 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
84 B lrwxr-xr-x 2025-06-03 18:38:25
Edit Download
1.08 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
296 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
154 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).