if (useIncludePath) path = env.lookupInclude(filename); else path = env.getPwd().lookup(filename);
path = env.getPwd().lookup(filename);
  public static BinaryStream fopen(Env env,				   String filename,				   String mode,				   @Optional boolean useIncludePath,				   @Optional Value context)  {    // XXX: context    try {      Path path;      if (useIncludePath)	path = env.lookupInclude(filename);      else	path = env.getPwd().lookup(filename);      if (mode.startsWith("r+")) {	throw new UnsupportedOperationException("read/write not yet supported");      }      else if (mode.startsWith("r")) {	try {	  return new FileInput(path);	} catch (IOException e) {	  log.log(Level.FINE, e.toString(), e);          env.warning(L.l("{0} cannot be read", path.getFullPath()));          return null;        }      }      else if (mode.startsWith("w+")) {	throw new UnsupportedOperationException("read/write not yet supported");      }      else if (mode.startsWith("w")) {	try {	  return new FileOutput(env, path);	} catch (IOException e) {	  log.log(Level.FINE, e.toString(), e);          env.warning(L.l("{0} cannot be written", path.getFullPath()));          return null;        }      }      else if (mode.startsWith("a+")) {	throw new UnsupportedOperationException("read/write not yet supported");      }      else if (mode.startsWith("a")) {	try {	  return new FileOutput(env, path, true);	} catch (IOException e) {	  log.log(Level.FINE, e.toString(), e);          env.warning(L.l("{0} cannot be written", path.getFullPath()));          return null;        }      }      else if (mode.startsWith("x+")) {	throw new UnsupportedOperationException("read/write not yet supported");      }      else if (mode.startsWith("x") && ! path.exists())        return new FileOutput(env, path);      env.warning(L.l("bad mode `{0}'", mode));      return null;    } catch (IOException e) {      log.log(Level.FINE, e.toString(), e);            env.warning(L.l("{0} can't be opened.\n{1}",		      filename, e.toString()));      return null;    }  }