INNER CODE UNIT · Python

count_rmm_tools

magicsword-io/LOLRMM · bin/generate_detections.py:341

def count_rmm_tools():
    """Count the number of YAML files and save as JSON"""
    yaml_dir = os.path.join(
        os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "yaml"
    )
    yaml_files = glob.glob(os.path.join(yaml_dir, "*.y*ml"))
    count = len(yaml_files)

    # Save count to JSON file for website to use
    output_dir = os.path.join(
        os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
        "website",
        "public",
        "api",
    )
    output_file = os.path.join(output_dir, "rmm_tools_count.json")

    with open(output_file, "w", encoding="utf-8") as file:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…