xoofx / zio

A cross-platform abstract/virtual filesystem framework with many built-ins filesystems for .NET
BSD 2-Clause "Simplified" License
817 stars 61 forks source link

Fix cross-filesystem operations in MountFileSystem #95

Closed GerardSmit closed 2 months ago

GerardSmit commented 2 months ago

While looking at #94, I saw a possible issue with MountFileSystem. It's possible for the MountFileSystem to not have a fallback filesystem, causing ResolvePath to throw an InvalidOperationException. The change in ComposeFileSystem fixes this problem.

After that I've implemented ResolvePathImpl in MountFileSystem, so it'll also use the move when the MountFileSystem isn't used directly, e.g.: https://github.com/xoofx/zio/blob/574a76d5e58434db98d7743f05fb9149e5a68f27/src/Zio.Tests/FileSystems/TestMemoryFileSystem.cs#L107

xoofx commented 2 months ago

Good catch, thanks!