Comments (5)
Here is the 'Exists' code that fails:
var fileInfo = new FileInfo(sourceFile);
if (fileInfo.Exists) {
... }
Another (besides createdTime and modifiedTime) that throws exceptions with Pri.LongPath is LastWriteTime.
from longpath.
I ran a test with a fake filename, and 'exists' works as expected. I need to look into this more.
from longpath.
The person has an 'H' drive that is mapped but is not connected. The file is nested inside this drive, and the path has been saved to DB. When Database is read, we check to see if the file exists. The drive is mapped, but not connected, so it should return 'False'. Instead it throws the above error.
i.e.
H:\Patent\Client\3582347 - (WH 7583) TestSubject\384572US03_2098\DRAFT\MyDraft v1.docx
Where H:\ is mapped but not connected.
from longpath.
I forgot to mention that this is with the Nuget 1.3.2
from longpath.
Can't reproduce with the latest build. Assume it's fixed by other changes. Returns false now, not an exception.
from longpath.
Related Issues (20)
- .NET Standard 2.0 support HOT 2
- DirectoryInfo.Refresh fails with UnauthorizedAccessException if executing principal has no access to parent folder HOT 1
- Path.GetPathRoot() throws ArgumentOutOfRangeException HOT 1
- The filename or extension is too long when creating a Directory on UNC
- Infinite sequence of elements when traversing the directory name consisting of single space HOT 3
- StreamWriter HOT 1
- Regression on 2.0.47.0 for DirectoryInfo HOT 2
- Can you document public methods HOT 1
- Mono support incomplete HOT 5
- File handles not being disposed HOT 2
- Path.GetPathRoot() throws IndexOutOfRangeException
- File.WriteAllText throws System.EntryPointNotFoundException on Mono HOT 1
- Endless loop
- File.Copy does two operations, for not win and then for win
- DirectoryInfo Delete mothod is throw exception HOT 1
- Have you considered merging with System.IO.Abstractions? HOT 1
- Error: Trying to create a parent directory, which exists but the current user has no permissions. HOT 1
- Consider checking for error upon subdirectory creation in Directory.CreateDirectory
- Long UNC pathname containing forward-slash (/) path separators is not normalised correctly
- Error with a really long and strange filename. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from longpath.