@JRubyMethod(name = "executable?") public IRubyObject executable_p() { return getRuntime().newBoolean(stat.isExecutable()); }
@JRubyMethod(name = "executable?") public IRubyObject executable_p() { return getRuntime().newBoolean(stat.isExecutable()); }
if (!executableOnly || (!stat.isDirectory() && stat.isExecutable())) return filename; } catch (Throwable t) {}
if (!executableOnly || (!stat.isDirectory() && stat.isExecutable())) return filename; } catch (Throwable t) {}
if (!executableOnly || (!stat.isDirectory() && stat.isExecutable())) return filename; } catch (Throwable t) {}
if (!executableOnly || (!stat.isDirectory() && stat.isExecutable())) return filename; } catch (Throwable t) {}
@JRubyMethod(name = "executable?") public IRubyObject executable_p() { checkInitialized(); return getRuntime().newBoolean(stat.isExecutable()); }
@JRubyMethod(name = "executable?") public IRubyObject executable_p() { checkInitialized(); return getRuntime().newBoolean(stat.isExecutable()); }
private static File isValidFile(Ruby runtime, String fdir, String fname, boolean isExec) { File validFile = null; if (isExec && Platform.IS_WINDOWS) { if (withExeSuffix(fname)) { validFile = tryFile(runtime, fdir, fname); } else { for (String suffix: WINDOWS_EXE_SUFFIXES) { validFile = tryFile(runtime, fdir, fname + suffix); if (validFile != null) { // found a valid file, no need to search further break; } } } } else { validFile = tryFile(runtime, fdir, fname); if (validFile != null) { if (validFile.isDirectory()) { return null; } if (isExec && !runtime.getPosix().stat(validFile.getAbsolutePath()).isExecutable()) { throw runtime.newErrnoEACCESError(validFile.getAbsolutePath()); } } } return validFile; }
private static File isValidFile(Ruby runtime, String fdir, String fname, boolean isExec) { File validFile = null; if (isExec && Platform.IS_WINDOWS) { if (withExeSuffix(fname)) { validFile = tryFile(runtime, fdir, fname); } else { for (String suffix: WINDOWS_EXE_SUFFIXES) { validFile = tryFile(runtime, fdir, fname + suffix); if (validFile != null) { // found a valid file, no need to search further break; } } } } else { validFile = tryFile(runtime, fdir, fname); if (validFile != null) { if (validFile.isDirectory()) { return null; } if (isExec && !runtime.getPosix().stat(validFile.getAbsolutePath()).isExecutable()) { throw runtime.newErrnoEACCESError(validFile.getAbsolutePath()); } } } return validFile; }
private static File isValidFile(Ruby runtime, String fdir, String fname, boolean isExec) { File validFile = null; if (isExec && Platform.IS_WINDOWS) { if (withExeSuffix(fname)) { validFile = tryFile(runtime, fdir, fname); } else { for (String suffix: WINDOWS_EXE_SUFFIXES) { validFile = tryFile(runtime, fdir, fname + suffix); if (validFile != null) { // found a valid file, no need to search further break; } } } } else { validFile = tryFile(runtime, fdir, fname); if (validFile != null) { if (validFile.isDirectory()) { return null; } if (isExec && !runtime.getPosix().stat(validFile.getAbsolutePath()).isExecutable()) { throw runtime.newErrnoEACCESError(validFile.getAbsolutePath()); } } } return validFile; }
private static File isValidFile(Ruby runtime, String fdir, String fname, boolean isExec) { File validFile = null; if (isExec && Platform.IS_WINDOWS) { if (withExeSuffix(fname)) { validFile = tryFile(runtime, fdir, fname); } else { for (String suffix: WINDOWS_EXE_SUFFIXES) { validFile = tryFile(runtime, fdir, fname + suffix); if (validFile != null) { // found a valid file, no need to search further break; } } } } else { validFile = tryFile(runtime, fdir, fname); if (validFile != null) { if (validFile.isDirectory()) { return null; } if (isExec && !runtime.getPosix().stat(validFile.getAbsolutePath()).isExecutable()) { throw runtime.newErrnoEACCESError(validFile.getAbsolutePath()); } } } return validFile; }
@JRubyMethod(name = "executable?", required = 1, module = true) public static IRubyObject executable_p(IRubyObject recv, IRubyObject filename) { Ruby runtime = recv.getRuntime(); FileResource file = fileResource(filename); return runtime.newBoolean(file.exists() && file.stat(runtime.getPosix()).isExecutable()); }
@JRubyMethod(name = "executable?", required = 1, module = true) public static IRubyObject executable_p(IRubyObject recv, IRubyObject filename) { Ruby runtime = recv.getRuntime(); JRubyFile file = file(filename); return runtime.newBoolean(file.exists() && runtime.getPosix().stat(file.getAbsolutePath()).isExecutable()); }