[cc65] Atari fopen()

From: Winslow, Dan D (US SSA) <dan.winslow1baesystems.com>
Date: 2009-03-12 16:33:36
Do the stdio functions work on Atari? The following code doesn't seem to
be able to open the file :

------------------------------------------------------
void load_bank(unsigned char bank, char *name)
{
  FILE *handle;
  int  size;

  page=0x4000;
  handle=fopen(bank,"r");
  printf("handle %i errno %i%c",handle,errno,155);
  if ( handle )
  {
    printf("open OK%c",155);
    while(1)
    {
      size=fread(page,256,1,handle);
      printf("read %i bytes%c",size,155);
      page+=size;
      if ( size < 256 ) break;
    }  
    fclose(handle);
  }else{
    printf("open of %s failed error %i%c",name,errno,155);
  }
}
------------------------------------------------------------

I get handle=0 and errno=1. Yes, I've checked to make sure the file is
actually on the disk :)

Dan Winslow


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Mar 12 16:33:48 2009

This archive was generated by hypermail 2.1.8 : 2009-03-12 16:33:50 CET