
import os
import sys

def list_dlls(directory):
    print(f"Listing DLLs in: {directory}")
    if not os.path.exists(directory):
        print("  Directory not found.")
        return

    try:
        files = os.listdir(directory)
        dlls = [f for f in files if f.lower().endswith('.dll')]
        
        print(f"Found {len(dlls)} DLLs:")
        for dll in sorted(dlls):
            print(f"  - {dll}")
            
    except Exception as e:
        print(f"  Error listing directory: {e}")

if __name__ == "__main__":
    # Rithmic DLL Directory
    # Default: C:\Program Files (x86)\Rithmic\Rithmic Trader Pro
    default_dir = r"C:\Program Files (x86)\Rithmic\Rithmic Trader Pro"
    
    target_dir = sys.argv[1] if len(sys.argv) > 1 else default_dir
    list_dlls(target_dir)
