Skip to content

Some mods rely on case insensitive filesystem #55

@jkahrman

Description

@jkahrman

Some mods ship with the library directory in the case "Library" (and in at least one case "LIbrary"). Since Windows uses a case insensitive filesystem, this does not pose a problem on that platform. Linux and Mac use a case-sensitive file system and therefore modloader doesn't see the files contained in the mod.

Consider looking for well know directories in a case-insensitive manner.

import os

def file_exists_insensitive(path):
    directory, filename = os.path.split(path)
    directory = directory or '.'  # Handle root directory
    filename_lower = filename.lower()
    for f in os.listdir(directory):
        if f.lower() == filename_lower:
            return os.path.join(directory, f)
    return None

Examples of mods with non-lowercase library directory:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmod issueIssue is in the loaded mods and not the mod loader

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions