Is it possible to add caching to a pipe? cat blah | in_RAM_cache_here -s SIZE | something else I'm doing what is essentially a cat (*) from a DVD directly to an NFS share. It looks like the two media (DVD and NFS) have very different read / write behaviors, speeds and timings, and the overall process is not as fast as possible. So I was wondering if some kind of cache inbetween might be beneficial. Except, I have no idea whether there's already a command line tool that can accomplish that (and I'm not so desperate as to try and implement one myself). (*) - 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 -- Florin Andrei http://florin.myip.org/
Am Samstag, den 05.09.2009, 08:32 +0200 schrieb Florin Andrei:> Is it possible to add caching to a pipe? > > cat blah | in_RAM_cache_here -s SIZE | something else >The porgram "buffer" might be what you need. Chris financial.com AG Munich head office/Hauptsitz M?nchen: Maria-Probst-Str. 19 | 80939 M?nchen | Germany Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany Management board/Vorstand: Dr. Steffen Boehnert (CEO/Vorsitzender) | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender) Register court/Handelsregister: Munich ? HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553
On 2009-09-05, at 2:32 AM, Florin Andrei <florin at andrei.myip.org> 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 -lhtccat -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