Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The filename or extension is too long when creating a Directory on UNC #79

Open
emilecastelnuovo opened this issue Apr 26, 2019 · 0 comments

Comments

@emilecastelnuovo
Copy link

emilecastelnuovo commented Apr 26, 2019

Using latest NuGet package: Pri.LongPath 2.0.47

When trying to create a Directory on a UNC path I get this error if the directory name contains an "extension" too long.
For example:
Directory.Create("\\sntsmb01\ApplicationSupport\Sviluppo\Deploy_Working\RIP_09733_ChangeManagement_PR_10125.IT_-20190426_01_Emile.Xxxxxxxxxxx\Cccccccccc\SmartClient\wwwroot_APPZ[SC] Cccccccccc.LimitsBuilder.2\Application Files\Xxxxxxx.Bre.Xxxxxx.Builder_4_5_0_214 ");

Workaround:
Create a fake Dir adding a fake extension like ".a" and then rename it using Directory.Move(fakeName, realName)

Stack Trace:
System.IO.PathTooLongException: The filename or extension is too long.

at Pri.LongPath.Directory.CreateDirectoryUnc(String path)
at Pri.LongPath.Directory.CreateDirectory(String path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant