def case_sensitive(path):
    """Check whether the filesystem at the given path is case sensitive.

    To work best, the path should point to a file or a directory. If the path
    does not exist, assume a case sensitive file system on every platform
    except Windows.
    """
    # A fallback in case the path does not exist.
    if not os.path.exists(syspath(path)):
        # By default, the case sensitivity depends on the platform.
        return platform.system() != 'Windows'

    # If an upper-case version of the path exists but a lower-case
    # version does not, then the filesystem must be case-sensitive.
    # (Otherwise, we have more work to do.)
    if not (os.path.exists(syspath(path.lower())) and
            os.path.exists(syspath(path.upper()))):
        return True

    # Both versions of the path exist on the file system. Check whether
    # they refer to different files by their inodes. Alas,
    # `os.path.samefile` is only available on Unix systems on Python 2.
    if platform.system() != 'Windows':
        return not os.path.samefile(syspath(path.lower()),
                                    syspath(path.upper()))

    # On Windows, we check whether the canonical, long filenames for the
    # files are the same.
    lower = _windows_long_path_name(path.lower())
    upper = _windows_long_path_name(path.upper())
    return lower != upper