What
|
Read and Write?
|
Linux
|
Windows
|
The disk itself. |
Reading these files reads raw bytes from the disk itself. Writing to these files changes the disk directly (watch out!).
|
Disks are a "block device file" like /dev/sda or /dev/fd0 (floppy)
|
\\.\PhysicalDrive0 or \\.\CdRom0 |
Input devices (keyboards, mice, joysticks). |
Reading the file returns what's happening on the device (for example,
how the mouse is moving); writing the file can turn on LEDs on the
keyboard, or make the joystick rumble. |
Input devices are in /dev/input (try "od -t x1 /dev/input/event1" and waggle the mouse). |
USB devices are named strange things like
"\\.\HID#Vid_062a&Pid_0102& mi_01&col04#7&bf1aa55&0&0003# {4d1e55b2-f16f-11cf-88cb-001111000030}",
but the HID enumerator routines let you list them. |
The graphics card
|
Reading the file can tell you
what's being rendered, or what the image is. Writing the file can
cause 3D stuff to start being drawn!
|
/dev/dri/card0
|
\\.\Display1
|
A process's memory
|
Reads and writes to memory--useful for a debugger, or learning.
|
/proc/self/mem
|
(I don't think this exists)
|
The console
|
Read returns stuff you've typed at the blinking cursor. Write prints stuff to the screen.
|
/dev/tty
|
CON
|
Emptiness
|
Read returns nothing. Write seems to work, but does nothing. This is useful for testing file I/O programs!
|
/dev/null
|
\\.\NUL
|