dokan-dev / dokan-dotnet

Dokan DotNet Wrapper
http://dokan-dev.github.io
MIT License
462 stars 116 forks source link

OpenFIle and ReadFile may have different file name in one loop #256

Closed NavigatorXia closed 4 years ago

NavigatorXia commented 4 years ago

When I tried to run a huge program(140000files) in my filesystem based on dokany, sometimes the info.context doesn't match my fileName in ReadFIle.

I logged the fileName when touched OpenFile, and verified it in ReadFile, sometimes there are different.

Liryna commented 4 years ago

@NavigatorXia Hi,

Are you sure they are not two open with different name. In the same time that pass and both lead so separate read?

NavigatorXia commented 4 years ago

@NavigatorXia Hi,

Are you sure they are not two open with different name. In the same time that pass and both lead so separate read?

I'm not very sure about the inner logic file system, I just add the following code under ReadFile (Sample Mirror), and logged the different. Code: if (stream.Name != GetPath(fileName).Replace("/", @"\")) { System.Diagnostics.Trace.WriteLine($".......Match......] Stream name: {stream.Name}; Read File: {fileName}"); }

Liryna commented 4 years ago

OK, you can have two context of open called for this read for example. A context can be like two different apps. One try to open your file in lower case and the other one upper case. If you allow both in create file, you will have read for the same file with different naming.

You might want to use case sensitive c# option when needed.

Le dim. 19 avr. 2020 à 15:53, NavigatorXia notifications@github.com a écrit :

@NavigatorXia https://github.com/NavigatorXia Hi,

Are you sure they are not two open with different name. In the same time that pass and both lead so separate read?

I'm not very sure about the inner logic file system, I just add the following code under ReadFile (Sample Mirror), and logged the different. Code: if (stream.Name != GetPath(fileName).Replace("/", @"")) { System.Diagnostics.Trace.WriteLine($".......Match......] Stream name: {stream.Name}; Read File: {fileName}"); }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dokan-dev/dokan-dotnet/issues/256#issuecomment-616140066, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABA4S65B63M446RAPSK5GWLRNL64PANCNFSM4MIHGY5Q .

Liryna commented 4 years ago

@NavigatorXia does it answer your question?

Liryna commented 4 years ago

@NavigatorXia let me know if you would like to reopen the ticket.