Thursday 15 July 2010

linux - How to print a content of file slowly or in bulks with delays between -


I am developing an application that produces a streaming binary data (using rtmpdump To STDOUT) During this download, for debugging purpose, I would like to change this type of stream download with STDOUT slow printing of the local file, so I know that the data will be processed.

Linux command cat file.bin is simple, but compared to stream downloads it is very fast when I used cat instead of the project I am working with data in small wholesale sizes, real streams, downloads and processes compared with that.

Should Linux commands be used to make such print slower? How do I manage this kind of print?

A small pearl script:

  Use warnings; Strict use; Open your $ F, "& lt;", "file.bin" or die ($!); Binmode ($ f); My $ buff; While (my $ len = read ($ f, $ buf, 100 * rand (+ + 10)) {print $ buf; Sleep Rand () * 2; } $ F;    

No comments:

Post a Comment