From e57d0fb642201049489ee134ac43e15e8ccb53e1 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 24 Apr 2023 09:38:46 +0200 Subject: [PATCH] prevent log spam --- .../cryptomator/frontend/fuse/ReadWriteAdapter.java | 4 +++- .../org/cryptomator/frontend/fuse/WindowsUtil.java | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java diff --git a/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java b/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java index e8a8355..810c312 100644 --- a/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java +++ b/src/main/java/org/cryptomator/frontend/fuse/ReadWriteAdapter.java @@ -160,7 +160,9 @@ public int chmod(String path, int mode, FileInfo fi) { LOG.warn("chmod {} failed, file not found.", path); return -errno.enoent(); } catch (UnsupportedOperationException e) { - LOG.warn("Setting posix permissions not supported by underlying file system."); + if (!WindowsUtil.IS_RUNNING_OS) { //prevent spamming warnings + LOG.warn("Setting posix permissions not supported by underlying file system."); + } return -errno.enosys(); } catch (IOException | RuntimeException e) { LOG.error("chmod {} failed.", path, e); diff --git a/src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java b/src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java new file mode 100644 index 0000000..d5705a1 --- /dev/null +++ b/src/main/java/org/cryptomator/frontend/fuse/WindowsUtil.java @@ -0,0 +1,10 @@ +package org.cryptomator.frontend.fuse; + +public class WindowsUtil { + + public static final boolean IS_RUNNING_OS = System.getProperty("os.name").toLowerCase().contains("windows"); + + private WindowsUtil() {} + + +}