xoofx / zio

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

Fix SubFileSystem watcher (sometimes) silently discarding events #92

Closed Metapyziks closed 4 months ago

Metapyziks commented 4 months ago

Fixes #91 by only calling Path.GetFullPath for non-rooted paths on Windows in PhysicalFileSystem.ConvertPathFromInternalImpl.

Paths from filesystem events are already rooted, so this skips the weird behaviour for paths containing a ~.

xoofx commented 4 months ago

That's great, thanks for spotting this and making a PR to fix it, appreciated!

gmkado commented 3 months ago

@xoofx this is a breaking change, should the package get a major version bump?

var fs = new PhysicalFileSystem();
fs.ConvertPathFromInternal(@"/test")

In 0.18.0 this results in to /mnt/c/test on windows but now throws an exception Expecting a drive for the path "\test"

xoofx commented 3 months ago

@xoofx this is a breaking change, should the package get a major version bump?

It is using semver 2.0, so 0.x.y is considered as unstable, so the API has never been stabilized, so technically, any 0.x.y can be a major version bump 🙂

That being said, if you can find a fix to workaround this, PR welcome.

@Metapyziks, would adding a check for the specific case of ~ would be enough? (I'm not sure what ~ is causing trouble with)

Metapyziks commented 3 months ago

Sorry for the delay, I'll have a look now.