view audio/private/pipein.m @ 2:7357e1dc2ad6

Simplified scheduler library with new schedule representation.
author samer
date Sat, 22 Dec 2012 16:17:51 +0000
parents 672052bd81f8
children ae596261e75f
line wrap: on
line source
function [str,cleanup]=pipein(cmd,q)
	if nargin<2, q=false; end
	if ~q, fprintf('Starting sub-process: %s\n',cmd); end
	process=java.lang.Runtime.getRuntime().exec({'bash','-c',cmd});
	str=process.getInputStream();
	cleanup=@dispose;

	function dispose
		if ~q, fprintf('Killing subprocess...\n'); end
		process.destroy();
	end
end