From 4c30684ec7a940680e559f6a8f226d9dc17c2598 Mon Sep 17 00:00:00 2001 From: juanf <juanf@ethz.ch> Date: Mon, 12 Jun 2023 15:12:35 +0200 Subject: [PATCH] SSDM-13521: Removing Posix in favour of Unix replacement --- .../source/java/ch/systemsx/cisd/base/unix/Unix.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib-base/source/java/ch/systemsx/cisd/base/unix/Unix.java b/lib-base/source/java/ch/systemsx/cisd/base/unix/Unix.java index 63ad45b0968..d1fbda3f526 100644 --- a/lib-base/source/java/ch/systemsx/cisd/base/unix/Unix.java +++ b/lib-base/source/java/ch/systemsx/cisd/base/unix/Unix.java @@ -42,7 +42,17 @@ public final class Unix } public static boolean isOperational() { - return File.separatorChar == '/'; //On Posix systems the value of this field is '/' + boolean isPosixFileSystem = File.separatorChar == '/'; //On Posix systems the value of this field is '/'; + boolean isIdCommandLineToolAvailable; + + try { + getUid(); + isIdCommandLineToolAvailable = true; + } catch (Throwable t) { + isIdCommandLineToolAvailable = false; + } + + return isPosixFileSystem && isIdCommandLineToolAvailable; } // -- GitLab