cp bug?

Joakim Tjernlund joakim.tjernlund at transmode.se
Fri Mar 28 15:50:22 UTC 2008


On Fri, 2008-03-28 at 16:35 +0100, Denys Vlasenko wrote:
> On Friday 28 March 2008 15:36, Joakim Tjernlund wrote:
> > I just tried to "cp /dev/mtdblock1 myfile" and I got
> > a copy of the mtdblock1 file, not the contents:
> >
> > > ls -l myfile 
> > brw-r-----    1 root     root      31,   1 Mar 28 15:33 myfile
> 
> Well, which behavior is correct is a question of taste.
> POSIX is silent on this.

OK, my taste would be that it copies the file contents, just like it
does for symlinks. Doesn't that make sense?

> 
> > Someone also mentioned problems copy files from /proc that has a zero
> > file size, i.e, it seemed like bb cp stats the file to get the size and
> > the copies that many bytes. Files in /proc don't always report correct
> > file size.
> 
> Correct, That's why cp does not trust the size, it copies until EOF is seen:

OK so I was misinformed, thanks.
Has this always been like this?

 Jocke



More information about the busybox mailing list