Skip to content

get_fat_mounts doesn't handle mount output on Mac #11

Description

@arthurjy

There are not 6 tokens to split line into.
Example Mac output:-

/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
//arthur@boadicea._afpovertcp._tcp.local/Media on /Volumes/Media (afpfs, nodev, nosuid, mounted by arthur)
//arthur@boadicea._afpovertcp._tcp.local/arthur%60s%20home on /Volumes/arthur's home (afpfs, nodev, nosuid, mounted by arthur)
/dev/disk1s1 on /Volumes/KENWOOD (msdos, local, nodev, nosuid, noowners)

Also note, the FAT formatted volume has a filesystem attribute of 'msdos'

I progressed past this point with this temporary fix:-

def get_fat_mounts():
    fat_mounts = []
    mounts = os.popen('mount')
    for line in mounts.readlines():
        #device, ign1, mount_point, ign2, filesystem, options = line.split()
        parts = line.split();
        device = parts[0];
        mount_point = parts[2];

        if 'fat' in line or 'msdos' in line:
            fat_mounts.append((mount_point, 'fat', device))
    return fat_mounts

However the checking if the mount point is of FAT (or MSDOS) type needs to be more robust.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions