@Deprecated // no longer used public static Stream fopen(Ruby runtime, String path, ModeFlags modes) throws FileNotFoundException, DirectoryAsFileException, FileExistsException, IOException, InvalidValueException, PipeException, BadDescriptorException { try { ChannelDescriptor descriptor = ChannelDescriptor.open(runtime.getCurrentDirectory(), path, modes, runtime.getClassLoader()); Stream stream = fdopen(runtime, descriptor, modes); return stream; } catch (ResourceException resourceException) { throw resourceException.newRaiseException(runtime); } }
public static Stream fopen(Ruby runtime, String path, ModeFlags modes) throws FileNotFoundException, DirectoryAsFileException, FileExistsException, IOException, InvalidValueException, PipeException, BadDescriptorException { ChannelDescriptor descriptor = ChannelDescriptor.open(runtime.getCurrentDirectory(), path, modes, runtime.getClassLoader()); Stream stream = fdopen(runtime, descriptor, modes); return stream; }
@Deprecated // no longer used public static Stream fopen(Ruby runtime, String path, ModeFlags modes) throws FileNotFoundException, DirectoryAsFileException, FileExistsException, IOException, InvalidValueException, PipeException, BadDescriptorException { try { ChannelDescriptor descriptor = ChannelDescriptor.open(runtime.getCurrentDirectory(), path, modes, runtime.getClassLoader()); Stream stream = fdopen(runtime, descriptor, modes); return stream; } catch (ResourceException resourceException) { throw resourceException.newRaiseException(runtime); } }
public static Stream fopen(Ruby runtime, String path, ModeFlags modes) throws FileNotFoundException, DirectoryAsFileException, FileExistsException, IOException, InvalidValueException, PipeException, BadDescriptorException { ChannelDescriptor descriptor = ChannelDescriptor.open(runtime.getCurrentDirectory(), path, modes, runtime.getClassLoader()); Stream stream = fdopen(runtime, descriptor, modes); return stream; }
return ChannelStream.fdopen(runtime, existingDescriptor, modes); } catch (InvalidValueException ive) { throw runtime.newErrnoEINVALError();
return ChannelStream.fdopen(runtime, existingDescriptor, modes); } catch (InvalidValueException ive) { throw runtime.newErrnoEINVALError();
protected void initSocket(Ruby runtime, ChannelDescriptor descriptor) { // continue with normal initialization MakeOpenFile(); try { openFile.setMainStream(ChannelStream.fdopen(runtime, descriptor, newModeFlags(runtime, ModeFlags.RDONLY))); openFile.setPipeStream(ChannelStream.fdopen(runtime, descriptor, newModeFlags(runtime, ModeFlags.WRONLY))); openFile.getPipeStream().setSync(true); } catch (org.jruby.util.io.InvalidValueException ex) { throw runtime.newErrnoEINVALError(); } openFile.setMode(OpenFile.READWRITE | OpenFile.SYNC); // see rsock_init_sock in MRI; sockets are initialized to binary setAscii8bitBinmode(); }
protected void initSocket(Ruby runtime, ChannelDescriptor descriptor) { // continue with normal initialization MakeOpenFile(); try { openFile.setMainStream(ChannelStream.fdopen(runtime, descriptor, newModeFlags(runtime, ModeFlags.RDONLY))); openFile.setPipeStream(ChannelStream.fdopen(runtime, descriptor, newModeFlags(runtime, ModeFlags.WRONLY))); openFile.getPipeStream().setSync(true); } catch (org.jruby.util.io.InvalidValueException ex) { throw runtime.newErrnoEINVALError(); } openFile.setMode(OpenFile.READWRITE | OpenFile.SYNC); // see rsock_init_sock in MRI; sockets are initialized to binary setAscii8bitBinmode(); }
selfFile.setMainStream(ChannelStream.fdopen(runtime, origDescriptor, origDescriptor.getOriginalModes())); selfFile.setPipeStream(pipeFile); } else { selfFile.getPipeStream().fclose(); ChannelDescriptor newFD2 = origFile.getPipeStream().getDescriptor().dup2(fd); selfFile.setPipeStream(ChannelStream.fdopen(runtime, newFD2, newIOOptions(runtime, "w").getModeFlags()));
selfFile.setMainStream(ChannelStream.fdopen(runtime, origDescriptor, origDescriptor.getOriginalModes())); selfFile.setPipeStream(pipeFile); } else { selfFile.getPipeStream().fclose(); ChannelDescriptor newFD2 = origFile.getPipeStream().getDescriptor().dup2(fd); selfFile.setPipeStream(ChannelStream.fdopen(runtime, newFD2, newIOOptions(runtime, "w").getModeFlags()));
newFile.setMainStream(ChannelStream.fdopen(runtime, descriptor, modes.getModeFlags()));
newFile.setMainStream(ChannelStream.fdopen(runtime, descriptor, modes.getModeFlags()));