EncodingUtils.extractModeEncoding(context, convconfig, vmode_vperm, opt, oflags_p, fmode_p);
if (fptr.IS_PREP_STDIO() &&
((fptr.getMode() & OpenFile.READWRITE) & (fmode_p[0] & OpenFile.READWRITE)) !=
(fptr.getMode() & OpenFile.READWRITE)) {
throw runtime.newArgumentError(fptr.PREP_STDIO_NAME() + " can't change access mode from \"" + fptr.getModeAsString(runtime) + "\" to \"" + OpenFile.getStringFromMode(fmode_p[0]));
}
fptr.setMode(fmode_p[0]);
fptr.encs = convconfig;
} else {
oflags_p[0] = OpenFile.getModeFlagsAsIntFrom(fptr.getMode());