public int chown(String filename, int user, int group) { try { return posix.chown(filename, user, group); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int chown(String filename, int user, int group) { return posix().chown(filename, user, group); }
public int chown(String filename, int user, int group) { try { return posix.chown(filename, user, group); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int chown(String filename, int user, int group) { return posix().chown(filename, user, group); }
public int chown(String filename, int user, int group) { return posix().chown(filename, user, group); }
public int chown(String filename, int user, int group) { try { return posix.chown(filename, user, group); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
public int chown(String filename, int user, int group) { return posix().chown(filename, user, group); }
public int chown(String filename, int user, int group) { try { return posix.chown(filename, user, group); } catch (UnsatisfiedLinkError ule) { return unimplementedInt(); } }
@Hide(OS.NT) public static void chown(PyObject path, int uid, int gid) { if (posix.chown(absolutePath(path).toString(), uid, gid) < 0) { throw errorFromErrno(path); } }
private void inplaceEdit(ThreadContext context, String filename, String extension) throws RaiseException { File file = new File(filename); FileStat stat = runtime.getPosix().stat(filename); if (extension.length() > 0) { file.renameTo(new File(filename + extension)); } else { file.delete(); } createNewFile(file); runtime.getPosix().chmod(filename, stat.mode()); runtime.getPosix().chown(filename, stat.uid(), stat.gid()); runtime.getGlobalVariables().set("$stdout", (RubyIO) RubyFile.open(context, runtime.getFile(), new IRubyObject[]{runtime.newString(filename), runtime.newString("w")}, Block.NULL_BLOCK)); }
private void inplaceEdit(ThreadContext context, String filename, String extension) throws RaiseException { File file = new File(filename); FileStat stat = runtime.getPosix().stat(filename); if (extension.length() > 0) { file.renameTo(new File(filename + extension)); } else { file.delete(); } createNewFile(file); runtime.getPosix().chmod(filename, stat.mode()); runtime.getPosix().chown(filename, stat.uid(), stat.gid()); runtime.getGlobalVariables().set("$stdout", (RubyIO) RubyFile.open(context, runtime.getFile(), new IRubyObject[]{runtime.newString(filename), runtime.newString("w")}, Block.NULL_BLOCK)); }
private void inplaceEdit(ThreadContext context, String filename, String extension) throws RaiseException { File file = new File(filename); FileStat stat = runtime.getPosix().stat(filename); if (!extension.equals("")) { file.renameTo(new File(filename + extension)); } else { file.delete(); } createNewFile(file); runtime.getPosix().chmod(filename, stat.mode()); runtime.getPosix().chown(filename, stat.uid(), stat.gid()); runtime.getGlobalVariables().set("$stdout", (RubyIO) RubyFile.open(context, runtime.getFile(), new IRubyObject[]{runtime.newString(filename), runtime.newString("w")}, Block.NULL_BLOCK)); } }
@JRubyMethod(required = 2) public IRubyObject chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { checkClosed(context); int owner = -1; if (!arg1.isNil()) { owner = RubyNumeric.num2int(arg1); } int group = -1; if (!arg2.isNil()) { group = RubyNumeric.num2int(arg2); } if (!new File(path).exists()) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chown(path, owner, group)); }
private void inplaceEdit(ThreadContext context, String filename, String extension) throws RaiseException { File file = new File(filename); FileStat stat = runtime.getPosix().stat(filename); if (!extension.equals("")) { file.renameTo(new File(filename + extension)); } else { file.delete(); } createNewFile(file); runtime.getPosix().chmod(filename, stat.mode()); runtime.getPosix().chown(filename, stat.uid(), stat.gid()); runtime.getGlobalVariables().set("$stdout", (RubyIO) RubyFile.open(context, runtime.getFile(), new IRubyObject[]{runtime.newString(filename), runtime.newString("w")}, Block.NULL_BLOCK)); } }
@JRubyMethod(required = 2) public IRubyObject chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { checkClosed(context); int owner = -1; if (!arg1.isNil()) { owner = RubyNumeric.num2int(arg1); } int group = -1; if (!arg2.isNil()) { group = RubyNumeric.num2int(arg2); } if (!new File(path).exists()) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chown(path, owner, group)); }
@JRubyMethod(required = 2) public IRubyObject chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { checkClosed(context); int owner = -1; if (!arg1.isNil()) { owner = RubyNumeric.num2int(arg1); } int group = -1; if (!arg2.isNil()) { group = RubyNumeric.num2int(arg2); } final String path = getPath(); if ( ! new File(path).exists() ) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chown(path, owner, group)); }
@JRubyMethod(required = 2) public IRubyObject chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { checkClosed(context); int owner = -1; if (!arg1.isNil()) { owner = RubyNumeric.num2int(arg1); } int group = -1; if (!arg2.isNil()) { group = RubyNumeric.num2int(arg2); } final String path = getPath(); if ( ! new File(path).exists() ) { throw context.runtime.newErrnoENOENTError(path); } return context.runtime.newFixnum(context.runtime.getPosix().chown(path, owner, group)); }
@JRubyMethod(required = 2, rest = true, meta = true) public static IRubyObject chown(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; int count = 0; int owner = -1; if (!args[0].isNil()) { owner = RubyNumeric.num2int(args[0]); } int group = -1; if (!args[1].isNil()) { group = RubyNumeric.num2int(args[1]); } for (int i = 2; i < args.length; i++) { JRubyFile filename = file(args[i]); if (!filename.exists()) { throw runtime.newErrnoENOENTError(filename.toString()); } if (0 != runtime.getPosix().chown(filename.getAbsolutePath(), owner, group)) { throw runtime.newErrnoFromLastPOSIXErrno(); } else { count++; } } return runtime.newFixnum(count); }
@JRubyMethod(required = 3, rest = true, meta = true) public static IRubyObject chown(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; int count = 0; int owner = -1; if (!args[0].isNil()) { owner = RubyNumeric.num2int(args[0]); } int group = -1; if (!args[1].isNil()) { group = RubyNumeric.num2int(args[1]); } for (int i = 2; i < args.length; i++) { JRubyFile filename = file(args[i]); if (!filename.exists()) { throw runtime.newErrnoENOENTError(filename.toString()); } if (0 != runtime.getPosix().chown(filename.getAbsolutePath(), owner, group)) { throw runtime.newErrnoFromLastPOSIXErrno(); } else { count++; } } return runtime.newFixnum(count); }
@JRubyMethod(required = 2, rest = true, meta = true) public static IRubyObject chown(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; int count = 0; int owner = -1; if (!args[0].isNil()) { owner = RubyNumeric.num2int(args[0]); } int group = -1; if (!args[1].isNil()) { group = RubyNumeric.num2int(args[1]); } for (int i = 2; i < args.length; i++) { JRubyFile filename = file(args[i]); if (!filename.exists()) { throw runtime.newErrnoENOENTError(filename.toString()); } if (0 != runtime.getPosix().chown(filename.getAbsolutePath(), owner, group)) { throw runtime.newErrnoFromLastPOSIXErrno(); } else { count++; } } return runtime.newFixnum(count); }