On Sat, Feb 19, 2005 at 01:23:10AM +0100, [EMAIL PROTECTED] wrote:
> 
>    On Fri, 18 Feb 2005 15:23:44 EST, Bill Davidsen said:
> 
>    > I'll try to build a truth table for this, I'm now working with some
>    > non-iso data sets, so I'm a bit more interested. I would expect read()
>    > to only try to read one sector, so I'll just do a quick and dirty to get
>    > the size from the command line, seek and read.
>    >
>    > I haven't had a problem using dd to date, as long as I know how long the
>    > data set was, but I'll try to have results tonight.
> 
>    The problem is that often you don't know exactly how long the data set is
>    (think "backup burned to CD/RW") - there's a *lot* of code that does stuff
>    like
> 
>            while (actual=read(fd,buffer,65536) > 0) {
>                    ...
>            }
> 
>    with the realistic expectation that the last read might return less than
>    64k,
>    in which case 'actual' will tell us how much was read.  Instead, we just 
> get
>    an error on the read.
> 
>    Note that 'dd' does this - that's why you get messages like '12343+1 blocks
>    read'.
>    We *really* want to get to a point where 'dd' will work *without* having to
>    tell it a 'bs=' and 'count=' to get the size right....
>    )

my point was that even specifying the exact byte count was not sufficient.
e.g

strace sdd if=/dev/zero bs=32k of=/dev/null ivsize=41234    gives:
......
munmap(0x46a000, 4096)                  = 0
_llseek(3, 0, [0], SEEK_SET)            = 0
_llseek(4, 0, [0], SEEK_SET)            = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 
32768
write(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 32768) = 
32768
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8466) = 
8466
write(2, "sdd: Done with input volume # 1."..., 33sdd: Done with input volume # 
1.
) = 33
write(2, "Do you want to continue with inp"..., 53Do you want to continue with 
input volume # 2 (y/n): ) = 53

that is, it requests exactly ivsize bytes (for iso cd's this can be got from 
isosize).

even this was not good enough....

Karl

-- 
Karl Kiniger   mailto:[EMAIL PROTECTED]
GE Medical Systems Kretztechnik GmbH & Co OHG
Tiefenbach 15       Tel: (++43) 7682-3800-710
A-4871 Zipf Austria Fax: (++43) 7682-3800-47
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to