Re: [cc65] scratch files on C64 or file spec and drive numbers

From: Dirk Jagdmann <doj1cubic.org>
Date: 2008-09-26 22:33:01
Hello all,

thanks for the response. If now written a small wrapper around the
remove() library function which handles the device number, similar to this:

int scratch_file(const char *fn, unsigned char dev)
{
  const unsigned char oldunit=_curunit;
  int e;
  _curunit=dev;
  e=remove(fn);
  if(e)
    {
      /* print some error */
    }
  _curunit=oldunit;
  return e;
}

My 2ยข for the discussion about a possible drive/device prefix. I would
like to have the numerical device number prefixed and separated by a
colon, like "8:testfile", "11:another file".

It is true, that the fnparse function would need to deal with 1 or 2
digit device numbers, but since we will do device I/O after that
anyways, which will always be slow, I don't mind spending some CPU
cycles on a numeric parser (at it's a 3 digit number anyways, if we
assume device numbers don't get larger than 255).

-- 
---> Dirk Jagdmann
----> http://cubic.org/~doj
-----> http://llg.cubic.org
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Sep 26 22:33:01 2008

This archive was generated by hypermail 2.1.8 : 2008-09-26 22:33:03 CEST