char *slash = (char *) strrchr(mFile, '/'); if (slash) { *slash = '\0'; rv = access(mFile, W_OK); *slash = '/'; } else { rv = access(".", W_OK); }  if (rv) return IO_ERROR;  return OK;
return AddFile::Prepare();
RemoveFile::Prepare(){  LOG(("PREPARE REMOVE %s\n", mFile));  // We expect the file to exist if we are to remove it.  int rv = access(mFile, F_OK);  if (rv) {    LOG(("file cannot be removed because it does not exist; skipping"));    mSkip = 1;    return OK;  }  char *slash = (char *) strrchr(mFile, '/');  if (slash) {    *slash = '\0';    rv = access(mFile, W_OK);    *slash = '/';  } else {    rv = access(".", W_OK);  }  if (rv)    return IO_ERROR;  return OK;}