Date: Tue, 19 Dec 2000 14:00:41 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: If dd doesn't support /dev/zero, what _does_ it support? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.