Mail Archives: djgpp/2000/12/19/07:03:44
On Mon, 18 Dec 2000, Damian Yerrick wrote:
> OK, I try to use the DJGPP port of GNU dd to create an 8 KB file
> filled with nul bytes. DJGPP presumably "transparently supports
> Unix-style devices such as `/dev/null' and `/dev/tty'" to an extent
> (DJGPP FAQ 22.21), but I can't get it to work.
>
> C:\kdg>dd if=/dev/zero of=kdg.chr count=8 bs=1024
> c:/personal/djgpp/bin/dd: /dev/zero: No such file or directory
> (ENOENT)
The /dev/zero device is not part of the emulated devices. The emulated
devices are those which have direct DOS equivalents; /dev/zero doesn't.
Please consider writing up a /dev/zero emulation and submitting it for
inclusion in a future DJGPP version.
> What's the proper method to make a file filled with zeroes?
calloc a buffer and write it to a file?
> And how do I list the supported devices?
You don't.
Apart of /dev/null and /dev/tty, the only ones that are supported are DOS
devices (whichever are installed on your system) when their names have
/dev/ or x:/dev/ (for any drive letter x:) prepended. Examples include
/dev/com1, /dev/prn, /dev/clock$, etc.
> This is what I get:
> C:\>ls /dev/
> c:/personal/djgpp/bin/ls: /dev/: No such file or directory (ENOENT)
This is expected behavior; that's the side effect of device emulation
mentioned in section 22.21 of the FAQ.
- Raw text -