[Python] Python - Checking if Drive is Mounted Not Working

Discussão em 'Python' iniciado por Stack, Março 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm running into a strange issue and I'm not sure what is going on at this point. I'm trying to check to use Python to check to see if a device is mounted.

    The following code returns true:

    disk_check = os.path.ismount("/dev")
    print(disk_check)


    But the second I try to find anything else, it always returns false, even if I run diskutil and can see /dev/disk1s1:

    disk_check = os.path.ismount("/dev/disk1s1")
    print(disk_check)


    Would anyone be able to provide any additional insight into what might be going on?

    Continue reading...

Compartilhe esta Página