Find the first existing path in the target path and check the filesystem capabilities for this path. This Fixes #2858