[PD-dev] fopen question

Jeffrey Hildebrand jshildebrand at ucdavis.edu
Sat Sep 13 02:42:48 CEST 2003


the only problem here is that fopen can't open hrir.bin. this code works
perfectly in linux but doesn't in windows. any ideas? 

scott

if(x->firstfloat == 0)
{
   t_int az, el, i;	
   FILE *fid;
										printf("hello1");

		fid = fopen("hrir.bin", "rb");               
		if(fid==NULL)
		{
			printf("Error: can't open file.\n");
			return 1;
		}
		else
		{
			printf("File opened successfully.\n");
		}

										printf("hello2");

		for(az=0; az<=24; az++)
		{							printf("hello3");
   		for(el=0; el<=49; el++) 
   		{           						printf("hello4");
	   		fread(x->bhrir_l[az][el], sizeof(float), 200, fid);	printf("hello5");

       	        	for(i=200; i<=1023; i++){x->bhrir_l[az][el][i]=0;} //adds
a bunch of zeroes
     	   	fread(x->bhrir_r[az][el], sizeof(float), 200, fid);
           			for(i=200; i<=1023; i++){x->bhrir_r[az][el][i]=0;}

printf("hello6");
		}
		}
		for(i=0; i<40; i++)
		{
			printf("%d\n", x->bhrir_r[5][i]);

		}
}//endif




More information about the Pd-dev mailing list