Re: [cc65] Uniform mass storage device discovery and file locations

From: Oliver Schmidt <ol.sc1web.de>
Date: 2012-08-16 13:56:46
Hi Karri,

> So in my case I would end up with something like: [...]

Okay, if you're not "looking for" a location to store but rather only
want to know if the one loaction you have in mind is there or not than
you're quite close to my proposal. I'm however thinking of strings,
not chars. The potential prototype of rootdir() I gave above was
incorrect as it needs to write into a buffer - sorry for the
confusion. I just looked it up once more in my Apple implementation.

So it would look something like this:

#define ROM0 0
#define ROM1 1
#define EEPROM 2

char eeprom[7];
if (rootdir(EEPROM, eeprom, sizeof(eeprom))) {
  // EEPROM exists
  char currentdrive[7];
  getcwd(currentdrive, sizeof(currentdrive));
  chdir(eeprom);
  fd = open("0", O_RDONLY);
  read(fd, &highscoretable, sizeof(highscoretable));
  //close(fd);
  chdir(currentdrive);
}

Regards,
Oliver
----------------------------------------------------------------------
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 Aug 16 13:56:57 2012

This archive was generated by hypermail 2.1.8 : 2012-08-16 13:57:01 CEST