-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filesystem notifications seemingly don't fire when they are supposed to (Windows 10, net6.0-windows) #310
Comments
If a file is created inside the virtual volume, you should not have any issues. To see if it is your fs the issue, you can try to reproduce with the DotNet sample and the native one. |
Okay, sounds good. I'll update you later this week once I have a chance to do that. |
Turns out I had time today xD If I feel like pursuing this, I will post on this thread with the solution I find to help others who might happen upon this. |
Don't hesitate to use procmon tool to compare the difference between the working sample and yours. |
Thank you for the suggestion! That will be helpful |
After hours of debugging, I found that the root cause of the issue was the fact that I hadn't implemented the FindFilesWithPattern method. I had done so purposefully because the documentation mislead me, it said that the dokan library would handle it. Perhaps it should be made more clear that implementors must still include an implementation, just that they can use the Dokan pattern helper to simplify the code. This is how my code ended up looking: public NtStatus FindFiles(string filePath, out IList<FileInformation> files, IDokanFileInfo info)
{
return FindFilesWithPattern(filePath, "*", out files, info);
}
public NtStatus FindFilesWithPattern(string filePath, string searchPattern, out IList<FileInformation> files, IDokanFileInfo info)
{
var node = archive.Root.Get(filePath, false);
if (node == null)
{
files = null;
return DokanResult.FileNotFound;
}
else if (node.Children == null)
{
files = null;
return DokanResult.NotADirectory;
}
files = node.Children.Values
.Where(n => DokanHelper.DokanIsNameInExpression(searchPattern, n.Name, true))
.Select(n => new FileInformation
{
Attributes = n.Children != null ? FileAttributes.Directory : FileAttributes.Normal,
FileName = n.Name,
Length = n.Stream?.Length ?? 0,
}).ToList();
return DokanResult.Success;
} |
Indeed! There is a TODO but no issue or documentation 😢 I created #311 dokan-dotnet/DokanNet/DokanOperationProxy.cs Line 655 in 2e16d06
Thanks @yodadude2003 for sharing the info! |
Ah that's fair enough. You're welcome! 😁👍 |
Hello,
I am having an issue with the most recent version of DokanNet (was happening with the previous version, too) where whenever I create, delete, or update files/directories in my mounted filesystem, I have to refresh the Windows Explorer view of the tree to see the changes reflected, even when the changes are triggered by Windows Explorer itself (i.e creating a new text file or folder).
You can see all of my code here. I used the Mirror sample as a starting point and worked from there. Relevant code is in ArchiveOperations.cs and Program.cs.
https://github.com/yodadude2003/DATOneArchiver/tree/dokan-driver/DATOneDriver
I don't know if its my code, or yours 😅
The text was updated successfully, but these errors were encountered: