Examples of FileStat


Examples of jnr.posix.FileStat

            throw runtime.newErrnoEACCESError(path);
        }

        // Since we transcode we depend on posix to lookup stat stuff since
        // java.io.File does not seem to cut it.  A failed stat will throw ENOENT.
        FileStat stat = runtime.getPosix().stat(directory.toString());

        // is not directory
        if (!stat.isDirectory()) throw runtime.newErrnoENOTDIRError(path);

        return directory;
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return fileTestModule;
    }

    @JRubyMethod(name = "blockdev?", required = 1, module = true)
    public static IRubyObject blockdev_p(IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return recv.getRuntime().newBoolean(stat != null && stat.isBlockDev());
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return recv.getRuntime().newBoolean(stat != null && stat.isBlockDev());
    }

    @JRubyMethod(name = "chardev?", required = 1, module = true)
    public static IRubyObject chardev_p(IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return recv.getRuntime().newBoolean(stat != null && stat.isCharDev());
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return context.runtime.newBoolean(fileResource(context, filename).isDirectory());
    }

    @JRubyMethod(name = "executable?", required = 1, module = true)
    public static IRubyObject executable_p(IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return recv.getRuntime().newBoolean(stat != null && stat.isExecutable());
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return recv.getRuntime().newBoolean(stat != null && stat.isExecutable());
    }

    @JRubyMethod(name = "executable_real?", required = 1, module = true)
    public static IRubyObject executable_real_p(IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return recv.getRuntime().newBoolean(stat != null && stat.isExecutableReal());
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return file_p(recv.getRuntime().getCurrentContext(), recv, filename);
    }

    @JRubyMethod(name = "file?", required = 1, module = true)
    public static RubyBoolean file_p(ThreadContext context, IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return context.runtime.newBoolean(stat != null && stat.isFile());
    }
View Full Code Here

Examples of jnr.posix.FileStat

    }

    @JRubyMethod(name = "grpowned?", required = 1, module = true)
    public static IRubyObject grpowned_p(IRubyObject recv, IRubyObject filename) {
        Ruby runtime = recv.getRuntime();
        FileStat stat = fileResource(filename).stat();

        // JRUBY-4446, grpowned? always returns false on Windows
        if (Platform.IS_WINDOWS) return runtime.getFalse();
       
        return runtime.newBoolean(stat != null && stat.isGroupOwned());
    }
View Full Code Here

Examples of jnr.posix.FileStat

            } else {
                return runtime.getFalse();
            }
        }

        FileStat stat1 = file1.stat();
        FileStat stat2 = file2.stat();

        return runtime.newBoolean(stat1 != null && stat2 != null && stat1.isIdentical(stat2));
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return runtime.newBoolean(stat1 != null && stat2 != null && stat1.isIdentical(stat2));
    }

    @JRubyMethod(name = "owned?", required = 1, module = true)
    public static IRubyObject owned_p(IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return recv.getRuntime().newBoolean(stat != null && stat.isOwned());
    }
View Full Code Here

Examples of jnr.posix.FileStat

        return recv.getRuntime().newBoolean(stat != null && stat.isOwned());
    }

    @JRubyMethod(name = "pipe?", required = 1, module = true)
    public static IRubyObject pipe_p(IRubyObject recv, IRubyObject filename) {
        FileStat stat = fileResource(filename).stat();

        return recv.getRuntime().newBoolean(stat != null && stat.isNamedPipe());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.