Hello,

I had problems using dd directly on a tape device with "skip=nnn" on 
Linux 2.2.14, because seek does not seem to report an error on a tape 
device. This was necessary to access Amanda backups with standard 
UNIX/Linux tools.

My change does a read when skips have to made and if the input is not 
a regular file. This way dd's skip works on all inputs including 
pipes and devices. I do not know how other systems handle seeks on 
pipes and devices, so this change might only be necessary on Linux 
(or maybe Linux has to change the way how seeks on devices are 
handled, at least it should return an error).



*** ../../fileutils-4.0/src/dd.c        Sat Sep 19 19:09:23 1998
--- dd.c        Tue Mar  7 17:09:54 2000
***************
*** 814,819 ****
--- 814,820 ----
       operation, fall back on using read.  */
    o = records * blocksize;
    if (o / blocksize != records
+       || !S_ISREG(stats.st_mode)
        || lseek (fdesc, o, SEEK_SET) == -1)
      {
        while (records-- > 0)


Roman

-- 
Roman Fietze (Mail Code 5023)       Heidelberg Digital Finishing GmbH
[EMAIL PROTECTED]                       [EMAIL PROTECTED]

Reply via email to