public static boolean isBlockDevice(String path) {
        if (!new File(path).exists()) {
            return false;
        }

        POSIX posix;
        try {
            posix = POSIXFactory.getNativePOSIX();
        } catch (Exception e) {
            LOGGER.warn("Failed to get native POSIX, fallback to check by prefix", e);
            return isBlockDeviceByPrefix(path);
        }

        try {
            return posix.stat(path).isBlockDev();
        } catch (Exception e) {
            // In some OS (like Windows), the isBlockDev() method may throw an IllegalStateException.
            LOGGER.warn("Failed to check if {} is a block device, fallback to check by prefix", path, e);
            return isBlockDeviceByPrefix(path);
        }
    }
Check if the given path is a block device.
If the path does not exist, it returns false
s3stream/src/main/java/com/automq/stream/s3/wal/util/WALUtil.java