public Channel open(String cwd, String path, ModeFlags flags, int perm) { return open(cwd, path, flags, perm); }
public Channel open(String cwd, String path, ModeFlags flags, int perm) { return open(cwd, path, flags, perm); }
@Deprecated // special case is already handled with JRubyFile.createResource public Channel open(String cwd, String path, ModeFlags flags, int perm, ClassLoader classLoader) { if (path.startsWith("classpath:/") && classLoader != null) { path = path.substring("classpath:/".length()); return Channels.newChannel(classLoader.getResourceAsStream(path)); } return open(cwd, path, flags, perm); }
@Deprecated // special case is already handled with JRubyFile.createResource public Channel open(String cwd, String path, ModeFlags flags, int perm, ClassLoader classLoader) { if (path.startsWith("classpath:/") && classLoader != null) { path = path.substring("classpath:/".length()); return Channels.newChannel(classLoader.getResourceAsStream(path)); } return open(cwd, path, flags, perm); }
public static ChannelFD cloexecOpen(Ruby runtime, Sysopen data) { Channel ret = null; if (OpenFlags.O_CLOEXEC.defined()) { data.oflags |= OpenFlags.O_CLOEXEC.intValue(); } else { // #elif defined O_NOINHERIT // flags |= O_NOINHERIT; } PosixShim shim = new PosixShim(runtime); ret = shim.open(runtime.getCurrentDirectory(), data.fname, data.oflags, data.perm); if (ret == null) { data.errno = shim.errno; return null; } ChannelFD fd = new ChannelFD(ret, runtime.getPosix(), runtime.getFilenoUtil()); if (fd.realFileno > 0 && runtime.getPosix().isNative()) { OpenFile.fdFixCloexec(shim, fd.realFileno); } return fd; }
public static ChannelFD cloexecOpen(Ruby runtime, Sysopen data) { Channel ret = null; if (OpenFlags.O_CLOEXEC.defined()) { data.oflags |= OpenFlags.O_CLOEXEC.intValue(); } else { // #elif defined O_NOINHERIT // flags |= O_NOINHERIT; } PosixShim shim = new PosixShim(runtime); ret = shim.open(runtime.getCurrentDirectory(), data.fname, data.oflags, data.perm); if (ret == null) { data.errno = shim.errno; return null; } ChannelFD fd = new ChannelFD(ret, runtime.getPosix(), runtime.getFilenoUtil()); if (fd.realFileno > 0 && runtime.getPosix().isNative()) { OpenFile.fdFixCloexec(shim, fd.realFileno); } return fd; }