|
guard let bytes = FileManager.default.contents(atPath: path) else { |
This should use the non-blocking NIOFileSystem APIs. They're both more easy to use and work correctly even if the file system blocks (Foundation.FileManager blocks the calling thread and uses different implementations on Linux & Darwin).