|
From: KJK::Hyperion <no...@li...> - 2001-11-06 18:26:30
|
At 03.16 06/11/2001 +0200, you wrote: > > More a programming exercise than an actual device driver, yet I haven't > > seen something like this yet for Windows NT: it's a zero stream >I do not know if related, but there is a device called null in Win2000, you >have to enable "Show hidden devices" in the device manager to see it. Null is the so-called "bit bucket": always returns EOF, zero bytes read when you try to read from it, always return OK, all bytes written (but actually they aren't written anywhere - the buffer is left untouched) when you try to write to it. Zero, instead, is a continuous stream of binary zeros. It's very handy when you need to initialize a binary file with the contents of another file, but you don't want to put any special data, just zero's. For example: dd if=\\.\ZERO of=\\.\A: (dd is a standard Unix command - it copies blocks from and to files and devices) erases the contents of the dos device A: (usually \Device\Floppy0) overwriting them with zero's dd if=\\.\ZERO of=\\.\C: bs=512 seek=1 erases the dos device C:, except the first 512 bytes (the boot record if C: is a hard disk) ==================================================== = To remove yourself from this mailing list, go to = = http://www.reactos.com/home/mailing.html = ==================================================== |