Refine search
@JRubyMethod(meta = true, name = "native_posix?") public static IRubyObject native_posix_p(ThreadContext context, IRubyObject self) { return context.runtime.newBoolean(context.runtime.getPosix().isNative()); }
@JRubyMethod(required = 1) public IRubyObject lchmod(ThreadContext context, IRubyObject arg) { int mode = (int) arg.convertToInteger().getLongValue(); if (!new File(path).exists()) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().lchmod(path, mode)); }
@JRubyMethod(name = "setrlimit", module = true, visibility = PRIVATE) public static IRubyObject setrlimit(ThreadContext context, IRubyObject recv, IRubyObject resource, IRubyObject rlimCur, IRubyObject rlimMax) { Ruby runtime = context.runtime; RLimit rlim = runtime.getPosix().getrlimit(0); if (rlimMax == context.nil) rlimMax = rlimCur; rlim.init(rlimitResourceValue(runtime, rlimCur), rlimitResourceValue(runtime, rlimMax)); if (runtime.getPosix().setrlimit(rlimitResourceType(runtime, resource), rlim) < 0) { throw runtime.newErrnoFromInt(runtime.getPosix().errno(), "setrlimit"); } return context.nil; }
@JRubyMethod(required = 1) public IRubyObject lchmod(ThreadContext context, IRubyObject arg) { int mode = (int) arg.convertToInteger().getLongValue(); if (!new File(path).exists()) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().lchmod(path, mode)); }
@JRubyMethod(rest = true, module = true, visibility = PRIVATE) public static RubyFixnum spawn(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; if (runtime.getPosix().isNative() && !Platform.IS_WINDOWS) { return PopenExecutor.spawn(context, args); } return RubyFixnum.newFixnum(runtime, ShellLauncher.runExternalWithoutWait(runtime, args)); }
@JRubyMethod(required = 1) public IRubyObject chmod(ThreadContext context, IRubyObject arg) { checkClosed(context); int mode = (int) arg.convertToInteger().getLongValue(); if (!new File(path).exists()) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chmod(path, mode)); }
@JRubyMethod(rest = true, module = true, visibility = PRIVATE) public static RubyFixnum spawn(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; if (runtime.getPosix().isNative() && !Platform.IS_WINDOWS) { return PopenExecutor.spawn(context, args); } return RubyFixnum.newFixnum(runtime, ShellLauncher.runExternalWithoutWait(runtime, args)); }
@JRubyMethod(required = 1) public IRubyObject chmod(ThreadContext context, IRubyObject arg) { checkClosed(context); int mode = (int) arg.convertToInteger().getLongValue(); if (!new File(path).exists()) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chmod(path, mode)); }
@JRubyMethod(name = "sticky?") public IRubyObject sticky_p() { Ruby runtime = getRuntime(); if (runtime.getPosix().isNative()) { return runtime.newBoolean(stat.isSticky()); } return runtime.getNil(); }
@JRubyMethod(required = 1) public IRubyObject chmod(ThreadContext context, IRubyObject arg) { checkClosed(context); int mode = (int) arg.convertToInteger().getLongValue(); final String path = getPath(); if ( ! new File(path).exists() ) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chmod(path, mode)); }
@JRubyMethod(name = "sticky?") public IRubyObject sticky_p() { checkInitialized(); Ruby runtime = getRuntime(); if (runtime.getPosix().isNative()) { return runtime.newBoolean(stat.isSticky()); } return runtime.getNil(); }
@JRubyMethod(required = 1) public IRubyObject chmod(ThreadContext context, IRubyObject arg) { checkClosed(context); int mode = (int) arg.convertToInteger().getLongValue(); final String path = getPath(); if ( ! new File(path).exists() ) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chmod(path, mode)); }
@JRubyMethod(name = "owned?", required = 1, module = true) public static IRubyObject owned_p(IRubyObject recv, IRubyObject filename) { Ruby runtime = recv.getRuntime(); FileResource file = fileResource(filename); return runtime.newBoolean(file.exists() && file.stat(runtime.getPosix()).isOwned()); }