[PD-dev] fopen question

Thomas Grill t.grill at gmx.net
Sat Sep 13 10:27:56 CEST 2003


Hi Jeffrey,
have you tried specifying a path?

T

> 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
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev
> 
> 




More information about the Pd-dev mailing list