annotate audio/private/pipein.m @ 6:0ce3c2070089

Removed duplicate code and fixed doc in timed_action.
author samer
date Mon, 14 Jan 2013 14:33:37 +0000
parents 672052bd81f8
children ae596261e75f
rev   line source
samer@0 1 function [str,cleanup]=pipein(cmd,q)
samer@0 2 if nargin<2, q=false; end
samer@0 3 if ~q, fprintf('Starting sub-process: %s\n',cmd); end
samer@0 4 process=java.lang.Runtime.getRuntime().exec({'bash','-c',cmd});
samer@0 5 str=process.getInputStream();
samer@0 6 cleanup=@dispose;
samer@0 7
samer@0 8 function dispose
samer@0 9 if ~q, fprintf('Killing subprocess...\n'); end
samer@0 10 process.destroy();
samer@0 11 end
samer@0 12 end