delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/12/19/07:03:44

Date: Tue, 19 Dec 2000 14:00:41 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
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: <s5vs3ts11k73ostso34l9hf9jkccjet7ii@4ax.com>
Message-ID: <Pine.SUN.3.91.1001219135532.365W-100000@is>
MIME-Version: 1.0
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019