/** * @deprecated use {@link #openChannel(int, int)} instead * * @param flags * @param perm * @return channel * @throws ResourceException */ default Channel openChannel(ModeFlags flags, int perm) throws ResourceException { try { return openChannel(flags.getFlags(), perm); } catch (ResourceException ex) { throw ex; } catch (IOException ex) { throw new ResourceException.IOError(ex); } }
/** * @deprecated use {@link #openChannel(int, int)} instead * * @param flags * @param perm * @return channel * @throws ResourceException */ default Channel openChannel(ModeFlags flags, int perm) throws ResourceException { try { return openChannel(flags.getFlags(), perm); } catch (ResourceException ex) { throw ex; } catch (IOException ex) { throw new ResourceException.IOError(ex); } }
Channel ch = JRubyFile.createResource(Ruby.getGlobalRuntime(), cwd, path).openChannel(flags, perm); return new ChannelDescriptor(ch, flags); } catch (NullPointerException npe) { npe.printStackTrace(); throw npe; }
public Channel open(String cwd, String path, int flags, int perm) { if ((path.equals("/dev/null") || path.equalsIgnoreCase("nul")) && Platform.IS_WINDOWS) { path = "NUL:"; } try { return JRubyFile.createResource(runtime, cwd, path).openChannel(flags, perm); } catch (ResourceException.FileExists e) { errno = Errno.EEXIST; } catch (ResourceException.FileIsDirectory e) { errno = Errno.EISDIR; } catch (ResourceException.FileIsNotDirectory e) { errno = Errno.ENOTDIR; } catch (ResourceException.NotFound e) { errno = Errno.ENOENT; } catch (ResourceException.PermissionDenied e) { errno = Errno.EACCES; } catch (ResourceException.TooManySymlinks e) { errno = Errno.ELOOP; } catch (ResourceException ex) { throw ex.newRaiseException(runtime); } catch (IOException ex) { throw runtime.newIOErrorFromException(ex); } return null; }
public Channel open(String cwd, String path, int flags, int perm) { if ((path.equals("/dev/null") || path.equalsIgnoreCase("nul")) && Platform.IS_WINDOWS) { path = "NUL:"; } try { return JRubyFile.createResource(runtime, cwd, path).openChannel(flags, perm); } catch (ResourceException.FileExists e) { errno = Errno.EEXIST; } catch (ResourceException.FileIsDirectory e) { errno = Errno.EISDIR; } catch (ResourceException.FileIsNotDirectory e) { errno = Errno.ENOTDIR; } catch (ResourceException.NotFound e) { errno = Errno.ENOENT; } catch (ResourceException.PermissionDenied e) { errno = Errno.EACCES; } catch (ResourceException.TooManySymlinks e) { errno = Errno.ELOOP; } catch (ResourceException ex) { throw ex.newRaiseException(runtime); } catch (IOException ex) { throw runtime.newIOErrorFromException(ex); } return null; }
Channel ch = JRubyFile.createResource(Ruby.getGlobalRuntime(), cwd, path).openChannel(flags, perm); return new ChannelDescriptor(ch, flags); } catch (NullPointerException npe) { npe.printStackTrace(); throw npe; }