bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: on "dd" using "seek" vs. "read" & >32-bit sizes


From: Paul Eggert
Subject: Re: on "dd" using "seek" vs. "read" & >32-bit sizes
Date: Fri, 16 Dec 2005 00:59:28 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Linda Walsh <address@hidden> writes:

> I can specify the "seek=BLOCKS" param, but it appears that "dd" doesn't
> translate this to a "seek" command but instead uses "read" to to
> sequentially access the block device.  Is this the case or am I
> hallucinating?

Normally it uses lseek:

   $ dd --version | sed 1q
   dd (coreutils) 5.93
   $ strace dd bs=1 seek=10 skip=20 if=/etc/motd of=/tmp/foox count=1
   ...
   _llseek(0, 20, [20], SEEK_CUR)          = 0
   ...
   _llseek(1, 10, [10], SEEK_CUR)          = 0
   read(0, "-", 1)                         = 1
   write(1, "-", 1)                        = 1
   ...

If you have devices that can't seek, it falls back on read/write.
strace might tell you why.

> Second question I had -- at times, it seems like various utils
> are limited to 2G file offsets on OS's (i686-linux, i686-cygwin)
> that support files >2G.  Is this "old" behavior

Yes; modern coreutils versions shouldn't have 2 GiB limits for file
sizes.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]