Handling for really long file/folder names
See original GitHub issueI’m guessing this doesn’t come up very often but when you try and read a message file with a really long file name (over 259 characters) or in my case in a very deep folder structure over 259 characters it returns the error “The provided file is not a valid IStorage\r\nParameter name: storageFilePath” although the file is a valid Outlook message file that will open in Outlook from that folder.
Here is an example folder structure I tested that I made deliberately complex to check other things in my code
Directory of C:\Temp\EmailTesting\Specific\Very long folder name, # , complex name\Very long folder name, # , complex name 1\Very long folder name, # , complex name 2\Very long folder name, # , complex name 3\Very long folder name, # , complex name 4\Samples-01
08/12/2010 16:57 50,176 Test File.msg
I did pass it in what I believe is the support .net structure for very long names with \?\ added to the start of the path e.g. \?\C:\Temp (mentioned here https://blogs.msdn.microsoft.com/jeremykuhne/2016/07/30/net-4-6-2-and-long-paths-on-windows-10/ )
As mentioned I’m sure this is an unusual use case but a fix would be appreciated.
Thanks very much, Dom
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
@domOrielton @FuchsiaSoft , In case you’re curious, I have the following unit-test in my code. There’s probably a better way to do this, but what it does is:
Note: You’ll probably have to change the depth of my code solution. This unit test’s bin/ directory is 4 directories above the solution, so I navigate down 4 “…/…/…/…/” when doing the GetFiles()
I’m going to close this issue since I’m not planning to change the MSGReader to support very long (because you are the only one who asked for it) filenames, because this probably gives issues elsewhere. If you want to get this into MSGReader then implement it and send me a pull request.