Why is it possible to open serial ports (COM) on windows using file functions?

4

How does this happen? There are other ways to open or just say this, in languages like C, PHP, Python, etc.

    
asked by anonymous 19.10.2015 / 07:18

1 answer

4

Because they are files. Or at least one way to. It's not just in Windows. It makes it much easier for the operating system to treat certain devices as if they were files. After all what you will do in a file is the same as you would on the device, read and write data. Files from the user's point of view are of data, where they are physically unimportant, except for the lower layers of the operating system.

This is the form available in the operating system.

    
19.10.2015 / 09:44