View tty used by applications
Try to use the command lsof
.
lsof /dev/ttyX
To get the PID directly, use:
lsof -Fp /dev/ttyX
Mac OS analog to /dev/ttyUSBxx
OS X doesn't create a /dev entry for raw access to USB devices, and there's no way to access them as TTY devices.
Partly this is a different in philosophy between Linux and BSD, partly it's a difference in driver-writing technology, and partly it's a matter of already having a well-defined hierarchy (the IOKit Registry) that would have to be mapped to the /dev hierarchy in some complicated way.
At any rate, if you want to learn how you should access USB devices on a Mac, start with QA1370. If you're looking to do a quick port of some linux code without actually learning IOKit/IOUSB, it's probably going to be impossible. If you're looking for something else, you'll need to give more info about what you're trying to do.
Related Topics
Python3 No Such File or Directory
How to Play an Audio File from Haskell Code, Cross-Platform
How to Set Environment Variable Within Gdb Using Shell Command
List Files That Are in Directory1 But Not in Directory2 and Vice Versa
How to Flush Stdout of a Running Process
Detecting If The Monitor Is Powered Off
Bash Command Line Arguments Passed to Sed via Ssh
Bash Cut Columns to One File and Save onto The End of Another File
Where M Flag and O Flag Will Be Stored in Linux
How to Clear Docker Task History
Terraform - Unable to Run Multiple Commands in Local Exec
How to Prevent Git from Committing Two Files with Names Differing Only in Case
Setfacl in Dockerfile Has No Effect
Can Not Route Packets from One Interface to Another
Pci-E Memory Space Access with Mmap