How to distinguish USB hard drives and SSDs from USB keys / pen drives on macOS
问题 How is it possible for code to distinguish between external USB hard drives and solid-state drives on the one hand versus USB sticks on the other hand? I'm not familiar with macOS APIs (or system calls, interrupts, messaging, and other things) but I'm guessing it would be in I/O Kit or Disk Arbitration? On the Terminal command line you can use system_profiler SPUSBDataType and see this information listed under "Removable Media". 回答1: You can get the removable/ejectable information directly