Comments (5)
What LongPath does is to sneak UNC into the mix to support up to 32k characters per path to avoid the PathTooLongException
. UNC still has limitations on each component (filename, directory name, etc.). Depending on the volume, the component limit is 255. The filename in your example is 256 characters. When a UNC component is longer that 255 Windows responds with an error 123 (ERROR_INVALID_NAME
). When LongPath encounters that error, it translates it to ArgumentException
. The same error in .NET would cause an IOException
with the same message and HResult. The fix would be to correct that use of ArgumentException
to be compatible with .NET
from longpath.
Actually the problem is a really too long filename, i'd like to have simply a better error message telling that the filename is simply too long.
from longpath.
I've opened the bug because we found this error on a log with a filename full of weird characters, and we were absolutely sure that one of the char was the issue, then we find that is a simple filename too long. :).
from longpath.
I've opened the bug because we found this error on a log with a filename full of weird characters, and we were absolutely sure that one of the char was the issue, then we find that is a simple filename too long. :).
Amusingly, a file name can only be up to 255 characters in a UNC filename. If you don't use UNC, you can get a 260 character file name in the root of the drive :)
from longpath.
Windows FileSystems are always amazing :D.
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
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.