Re: Re-string problems, code(2 of ?)

From: Charles Erwin (Mystikarc@aol.com)
Date: 07/16/00


ALL code is in objsave.c


int Crash_delete_file(char *name)
{
  char filename[50];
  FILE *fl;

  if(!xap_objs) {
    if (!get_filename(name, filename, CRASH_FILE))
      return (0);
  } else {
    if(!get_filename(name,filename,NEW_OBJ_FILES))
      return (0);
  }

  if (!(fl = fopen(filename, "rb"))) {
    if (errno != ENOENT)        /* if it fails but NOT because of no file */
      log("SYSERR: deleting crash file %s (1): %s", filename,
strerror(errno));
    return (0);
  }



  return (1);
}


int Crash_delete_crashfile(struct char_data * ch)
{
  char fname[MAX_INPUT_LENGTH];
  struct rent_info rent;
  FILE *fl;
  int rentcode,timed,netcost,gold,account,nitems;
  char line[MAX_INPUT_LENGTH];

  if(!xap_objs) {
    if (!get_filename(GET_NAME(ch), fname, CRASH_FILE))
      return (0);
  } else {
    if(!get_filename(GET_NAME(ch), fname,NEW_OBJ_FILES))
      return (0);
  }

  if (!(fl = fopen(fname, "rb"))) {
    if (errno != ENOENT)        /* if it fails, NOT because of no file */
      log("SYSERR: checking for crash file %s (3): %s", fname,
strerror(errno));
    return (0);
  }


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT