Skip to content
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

DirectoryInfo.LastWriteTime throws FileNotFoundException on the root folder of a drive #18

Closed
thomaslevesque opened this issue Apr 1, 2015 · 2 comments

Comments

@thomaslevesque
Copy link
Contributor

System.IO.FileNotFoundException: File D:\ not found
File name: 'D:\'
   at Pri.LongPath.Common.ThrowIOError(Int32 errorCode, String maybeFullPath)
   at Pri.LongPath.FileSystemInfo.get_LastWriteTimeUtc()
   at Pri.LongPath.FileSystemInfo.get_LastWriteTime()
   at UserQuery.Main() in c:\Users\Tom\AppData\Local\Temp\LINQPad\_himmmwze\query_ijinft.cs:line 56

The same error occurs for all the creation/modification/las access properties.

In System.IO.DirectoryInfo, it works as expected.

@peteraritchie
Copy link
Owner

I've reproduced and I'll have a look at it, probably today. thanks

@peteraritchie
Copy link
Owner

Added test to detect the problem and added fix. FindFirstFile does not work with root dir and no wildcard--fix was to add a wildcard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants