oflag option in GNU dd - equivalent in FreeBSD dd ?
Dan Nelson
dnelson at allantgroup.com
Tue Oct 23 09:32:09 PDT 2007
In the last episode (Oct 23), Oliver Fromme said:
> Bahman M. <b.movaqar at adempiere.org> wrote:
> > On 2007-10-22 Juri Mianovich wrote:
> > > I am used to using this command in Linux, using GNU
> > > dd:
> > >
> > > dd if=/blah of=/bleh oflag=append conv=notrunc
> > >
> > > The problem is, FreeBSD 'dd' does not understand the
> > > "oflag" argument.
> > >
> > > Is there some equivalent in the FreeBSD 'dd' syntax
> > > that I can use, or am I forced to install GNU utils ?
>
> Of course, the easiest way is to do this:
>
> $ dd if=/blah >> /bleh
>
> If you cannot do that, please explain why. If you know
> your reason, there might be an alternative way to do it.
>
> > dd if=/blah of=/bleh conv=notrunc seek=`ls -s /bleh | cut -f1 -d ' ' -`
> >
> > I don't know if any simpler way is possible (anyone?).
>
> $ dd if=/blah of=/bleh conv=notrunc seek=$(stat -f%z /bleh)
I don't think that will work, since seek's argument is in blocks. Even
if you divide by 512 (or whatever you decide to set bs=), if the file
you're appending do isn't a multiple of the blocksize, you'll end up
chopping part of the end off.
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-questions
mailing list