question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ZetaLongPaths can't move files from long source path on Windows Server 2012

See original GitHub issue

There 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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
arturkulacommented, Aug 24, 2018

Yes, fine, until there is a workaround I’m happy 😃

1reaction
arturkulacommented, Aug 24, 2018

There is some inconsistence:

  1. When moving file to destination path that is short and contains \\ - this works.
  2. When moving file to destination path that is long and contains \\ - 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found