ZetaLongPaths can't move files from long source path on Windows Server 2012
See original GitHub issueThere is an exception when ZetaLongPaths moves files from long source path on Windows Server 2012. Operating system is up to date. Source path + name of file limit is 256 chars, after this length the problem starts to occur.
Method:
ZlpIOHelper.MoveFile(source, destination);
Exception:
System.ComponentModel.Win32Exception (0x80004005): Error 123 moving file
'\\?\C:\Program Files (x86)\xxxx.txt'
to'\\?\D:\xxxxx.txt'
: The filename, directory name, or volume label syntax is incorrect. at ZetaLongPaths.ZlpIOHelper.MoveFile(String sourceFilePath, String destinationFilePath, Boolean overwriteExisting) in c:\P\ZetaLongPaths\Source\RuntimeNetCore\ZlpIOHelper.cs:line 489
Is there any solution to this problem?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (5 by maintainers)
Top Results From Across the Web
A file copy operation fails when files or folders have long ...
The copy operation fails and generates a message that states that the path (file name) is too long. The message also suggests that...
Read more >Windows Server 2012R2 Error "file path is too long"
Question, i am migrating our old 2003 file server to win 2012R2 but got the file path is too long for the destination...
Read more >Zeta Long Paths
A .NET library to access files and directories with more than 260 characters length.
Read more >c# - Best way to resolve file path too long exception
What worked for me is moving my project as it was on the desktop (C:\Users\lachezar.l\Desktop\MyFolder) to (C:\0\MyFolder) which as you can see ...
Read more >Windows Server 2012 R2 Standard “Enable NTFS long ...
Moving this subfolder to another location i.e. shorter path does not solve the problem as the deleted files will not be restorable from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, fine, until there is a workaround I’m happy 😃
There is some inconsistence:
\\
- this works.\\
- this do not work.I think this should work the same whether path is long or short. If
\\
is legal in path it should work in short and long path. If\\
is illegal in paths it should not work in both short and long paths.I can’t tell how to fix this in code. I managed to fix our internal code to not to generate
\\
in paths.