@JRubyMethod(name = "inspect") public IRubyObject inspect() { StringBuilder buf = new StringBuilder("#<"); buf.append(getMetaClass().getRealClass().getName()); buf.append(" "); // FIXME: Obvious issue that not all platforms can display all attributes. Ugly hacks. // Using generic posix library makes pushing inspect behavior into specific system impls // rather painful. try { buf.append("dev=0x").append(Long.toHexString(stat.dev())); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("ino=").append(stat.ino()); } catch (Exception e) {} finally { buf.append(", "); } buf.append("mode=0").append(Integer.toOctalString(stat.mode())).append(", "); try { buf.append("nlink=").append(stat.nlink()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("uid=").append(stat.uid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("gid=").append(stat.gid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("rdev=0x").append(Long.toHexString(stat.rdev())); } catch (Exception e) {} finally { buf.append(", "); } buf.append("size=").append(sizeInternal()).append(", "); try { buf.append("blksize=").append(stat.blockSize()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("blocks=").append(stat.blocks()); } catch (Exception e) {} finally { buf.append(", "); } buf.append("atime=").append(atime()).append(", "); buf.append("mtime=").append(mtime()).append(", "); buf.append("ctime=").append(ctime()); buf.append(">"); return getRuntime().newString(buf.toString()); }
@JRubyMethod(name = "inspect") public IRubyObject inspect() { StringBuilder buf = new StringBuilder("#<"); buf.append(getMetaClass().getRealClass().getName()); buf.append(" "); // FIXME: Obvious issue that not all platforms can display all attributes. Ugly hacks. // Using generic posix library makes pushing inspect behavior into specific system impls // rather painful. try { buf.append("dev=0x").append(Long.toHexString(stat.dev())); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("ino=").append(stat.ino()); } catch (Exception e) {} finally { buf.append(", "); } buf.append("mode=0").append(Integer.toOctalString(stat.mode())).append(", "); try { buf.append("nlink=").append(stat.nlink()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("uid=").append(stat.uid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("gid=").append(stat.gid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("rdev=0x").append(Long.toHexString(stat.rdev())); } catch (Exception e) {} finally { buf.append(", "); } buf.append("size=").append(sizeInternal()).append(", "); try { buf.append("blksize=").append(stat.blockSize()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("blocks=").append(stat.blocks()); } catch (Exception e) {} finally { buf.append(", "); } buf.append("atime=").append(atime()).append(", "); buf.append("mtime=").append(mtime()).append(", "); buf.append("ctime=").append(ctime()); buf.append(">"); return getRuntime().newString(buf.toString()); }
try { buf.append("uid=").append(stat.uid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("gid=").append(stat.gid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("rdev=0x").append(Long.toHexString(stat.rdev())); } catch (Exception e) {} finally { buf.append(", "); } buf.append("size=").append(sizeInternal()).append(", "); try {
@JRubyMethod(name = "rdev") public IRubyObject rdev() { return getRuntime().newFixnum(stat.rdev()); }
@JRubyMethod(name = "rdev") public IRubyObject rdev() { return getRuntime().newFixnum(stat.rdev()); }
try { buf.append("uid=").append(stat.uid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("gid=").append(stat.gid()); } catch (Exception e) {} finally { buf.append(", "); } try { buf.append("rdev=0x").append(Long.toHexString(stat.rdev())); } catch (Exception e) {} finally { buf.append(", "); } buf.append("size=").append(sizeInternal()).append(", "); try {
@JRubyMethod(name = "rdev_major") public IRubyObject rdevMajor() { return getRuntime().newFixnum(stat.major(stat.rdev())); }
@JRubyMethod(name = "rdev") public IRubyObject rdev() { checkInitialized(); return getRuntime().newFixnum(stat.rdev()); }
@JRubyMethod(name = "rdev") public IRubyObject rdev() { checkInitialized(); return getRuntime().newFixnum(stat.rdev()); }
@JRubyMethod(name = "rdev_minor") public IRubyObject rdevMinor() { return getRuntime().newFixnum(stat.minor(stat.rdev())); }
@JRubyMethod(name = "rdev_major") public IRubyObject rdevMajor() { return getRuntime().newFixnum(stat.major(stat.rdev())); }
@JRubyMethod(name = "rdev_minor") public IRubyObject rdevMinor() { return getRuntime().newFixnum(stat.minor(stat.rdev())); }
@JRubyMethod(name = "rdev_minor") public IRubyObject rdevMinor() { checkInitialized(); if (Platform.IS_WINDOWS) return getRuntime().getNil(); return getRuntime().newFixnum(stat.minor(stat.rdev())); }
@JRubyMethod(name = "rdev_major") public IRubyObject rdevMajor() { checkInitialized(); if (Platform.IS_WINDOWS) return getRuntime().getNil(); return getRuntime().newFixnum(stat.major(stat.rdev())); }
@JRubyMethod(name = "rdev_minor") public IRubyObject rdevMinor() { checkInitialized(); if (Platform.IS_WINDOWS) return getRuntime().getNil(); return getRuntime().newFixnum(stat.minor(stat.rdev())); }
@JRubyMethod(name = "rdev_major") public IRubyObject rdevMajor() { checkInitialized(); if (Platform.IS_WINDOWS) return getRuntime().getNil(); return getRuntime().newFixnum(stat.major(stat.rdev())); }