Re: caching pipe?

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



On 2009-09-05, at 2:32 AM, Florin Andrei <florin@xxxxxxxxxxxxxxx> wrote:

> Is it possible to add caching to a pipe?
>
> cat blah | in_RAM_cache_here -s SIZE | something else
<snip>

I beleive dd does what you want.

> (*) - it's actually tccat, part of the transcode package, but the idea
> is the same. Here's the actual command:
>
> n=14
> for i in `seq -w 1 ${n}`; do
>    echo "${i} out of ${n}"
>    tccat -i /dev/dvd -T 1,${i} > ch${i}.mpeg
> done
> sync
> ls -lh


tccat -i /dev/dvd -T 1,${i} | dd of=ch${i}.mpeg bs=1M

will read 1 MiB blocks, one at a time from tccat then write it to the  
file. I'm fairly certain that it doesn't write any data until either  
there is no more data to read or it has read a complete block.

Michael
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux