[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] PATCH: cp /dev/null some_file
From:       Anthony Shipman <als () labyrinth ! net ! au>
Date:       2004-05-30 16:55:56
Message-ID: 200405310255.57065.als () labyrinth ! net ! au
[Download RAW message or body]

On Sun, 30 May 2004 11:08 pm, tom@ceisystems.com wrote:
> Anthony,
>
> > Below is a bug fix for the common idiom
> > 	cp /dev/null some_file
> > to create an empty file.
>
> I know this is getting a little off subject here, but what is the
> _correct_ thing to do when cp gets a device file for its source? Should
> it copy the dev file? I would think this would be the proper thing to
> do. What I'm getting at here is this- should we taint busybox with fixes
> for broken thinking? Isn't this what makes glibc and all of the standard
> tools so big?
>
> Thomas Cameron

Being able to cp from /dev/null is one of the things it is there for.
I hit this problem when installing postgresql using busybox as the
shell. The installation script was trying to create an empty file
as shown above.

What makes tools big is having special cases. The idea of devices
as files is to avoid special cases i.e. you can copy from any character
device the same way you can copy from any file e.g. with the cp command.

If you want to duplicate device files then have a command line flag to
specify this behaviour.
 
-- 
Anthony Shipman                    Elektrichore - The muse of 
als@labyrinth.net.au                          high technology.

_______________________________________________
busybox mailing list
busybox@mail.busybox.net
http://codepoet.org/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic