UweKeim / ZetaLongPaths

A .NET library to access files and directories with more than 260 characters length.
https://nuget.org/packages/ZetaLongPaths
MIT License
141 stars 28 forks source link

Check to ZlpFileInfo.Exists inaccurately shows "TRUE" #37

Closed msbair closed 3 years ago

msbair commented 3 years ago

We have a process that checks whether a file exists or not and does something based on this check. The ZlpFileInfo inaccurately states the file exists when it does not:

\\{LONG_NETWORK_PATH\~$HIDDEN_EXCEL_FILE_LOCK.xlsm

For example:

\\xyz.com\dfsroot-us\shared\G\PMOutput\Mont\F\~$F_vPrd.xlsm

UweKeim commented 3 years ago

I've just did a quick test:

var a = new ZlpFileInfo(@"\\nas001\data\Users\ukeim\Ablage\F~$F_vPrd.xlsm");
var exists = a.Exists;

Assert.IsFalse(exists);

This assertion did not fire. I.e. exists is "false", just as I would expect.

So while this might still be an issue in the library, as of now I cannot reproduce it.

Could you please assemble a Minimal, Reproducible Example?

msbair commented 3 years ago

I wonder if it has to do with it being on a network share?

I'll try and create a reproducible example.

Smurf-IV commented 3 years ago

?? network share might have "Cacheable" items on, so returns true until actual existence is tested via an open.

msbair commented 3 years ago

It works as expected on local drive.

msbair commented 3 years ago

System.IO.FileInfo functions the same as ZlpFileInfo.