Subject: Copying to devices
To: None <current-users@NetBSD.ORG>
From: David Jones <>
List: current-users
Date: 07/30/1995 01:06:49
If an I/O error occurs upon writing to a file (as opposed to opening it),
then cp will remove the file.  This is true even if the file is
a special device or named pipe.

My immediate problem with this is that my firewall code gets its filter
tables reloaded by having them copied to /dev/firewall.  If the format
of the data so copied is bad, then the code itself returns EIO.  But
cp will then happily remove my device node.  There's no easy way to
report errors in the bitstream - even returning a short read will cause
cp to remove the device.

- Was it meant to work this way?  Are there other situations where copying
  can get you into trouble?  I can envision copying to /dev/tty and...
- Is there anything I can do other than provide a separate binary to
  load my filter table?

David Jones, M.A.Sc student, Electronics Group (VLSI), University of Toronto
           email:, finger for PGP public key
         For a good time, telnet and log in as `guest'.
          Click me!