On Mac, you can get a listing of /Volumes, and ignore whichever entry is a symlink to / (since that is the boot drive). This will give you both external drives and network shares; I’m not sure if there is an easy way to distinguish the two; one possibility is that physical drives seem to be owned by root, and network shares are owned by the user that connected to them.
A potential cross-platform option would be to parse the output of the mount command (with no arguments, it prints a list of mounted volumes). But the filtering could be a challenge. The Linux-specific solution is probably somewhere in /proc, but I don’t know where. Andy -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.