// Scilab 4+ Implementation of BinaryMatrixFile
function binWrite(fileName,data)

	rows = size(data,1);
	cols = size(data,2);

	arch64 = part(sprintf("%li",2^32),[1]) <> '-';

	fhand = mopen(fileName,"wb");

	if arch64;
		mput(rows,"ib",fhand);
		mput(cols,"ib",fhand);
	else;		
		mput(rows,"lb",fhand);
		mput(cols,"lb",fhand);
	end;

	mput(data',"db",fhand);
	
	mclose(fhand);	

endfunction
