rem: fs.open(controlDataFile, 'a', undefined, function(error, fd){ if(error){ if(fd){ fs.close(); } console.log('Error opening fifo: ' +error); return; } fs.write(fd, input, 0, input.length, null, function(error, written, buffer){ if(fd){ fs.close(fd); } if(error){ console.log('Error writing to fifo: ' + error); } else{ if(written != input.length){ console.log("Error: Did not write all data to fifo stream"); } } }); }); 
add: for(var i = 0; i < input.length; i++){ stream.write(input[i]); } 
context: function writeToFile(input){	fs.open(controlDataFile, 'a', undefined, function(error, fd){		if(error){			if(fd){				fs.close();			}			console.log('Error opening fifo: ' +error);		return;		}		fs.write(fd, input, 0, input.length, null, function(error, written, buffer){			if(fd){				fs.close(fd);			}			if(error){				console.log('Error writing to fifo: ' + error);			}			else{				if(written != input.length){					console.log("Error: Did not write all data to fifo stream");				}			}		});	});}
meta: 10965	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10965/7d0510801dadc75e82b1856b4bf667ba8da0e0bd/BeagleQuadServer.js/buggy/code/ControlTower/BeagleQuadServer.js