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.

error | Error: ENAMETOOLONG: name too long, open [DUE TO:] [WINDOWS limitation of 255 chars / path segment length] [Linux limitation of 255 chars / path length]

See original GitHub issue

Hello,

I have tried to generate the csharp code from a swagger that has a pretty deep level of nesting and got this error:


autorest readme.md --csharp

>> error I got:
error   |   Error: ENAMETOOLONG: name too long, open 'C:/swagger/generated/Models/ComponentsPidniwSchemasNfadevicePropertiesSpecPropertiesDeviceEos4271FPropertiesNetworkinstanceItemsPropertiesProtocolItemsPropertiesBgpPropertiesRibPropertiesAfisafiItemsPropertiesIpv4UnicastPropertiesLocribPropertiesRouteItemsPropertiesUnknownattributeItems.cs'

This issue looks like a regression of https://github.com/Azure/autorest/issues/3474

I have tried with the latest version of autorest. The version from https://github.com/Azure/autorest/issues/3474 just blocks, probably it is not supported anymore by the dotnet version I have installed.

Thank you.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ader1990commented, Feb 8, 2022

Nonetheless, seems that the path segment is still limited to 255 characters.

It would be nice if Windows documents contained this kind of information.

I suppose we can close this issue with a non-solvable tag, because of a Windows limitation, in this case. FWIW, the autorest model generation on Windows ended up producing much more results, as the path segment is limited to 255 chars versus the Linux limitation for full path at 255 chars.

Thank you, Adrian Vladu

0reactions
timotheeguerincommented, Feb 8, 2022

If you notice the 1st one the filename is 256 char long and the 2nd is 255 which as far as I can tell is still the limit for path segments regardless of the total path limit.

If you just try to create the file in windows it will fail as well. image

There isn’t anything autorest can do here unless this isn’t the case. That filename anyway must be due to a very nested set of anonymous definitions which have no names and would result in a terrible SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ENAMETOOLONG: name too long, error on Ubuntu #3474
error | Error: ENAMETOOLONG: name too long, open [DUE TO:] [WINDOWS limitation of 255 chars / path segment length] [Linux limitation of 255...
Read more >
Maximum Path Length Limitation - Win32 apps | Microsoft Learn
Enable Long Paths in Windows 10, Version 1607, and Later ... the maximum length for a path is MAX_PATH, which is defined as...
Read more >
To what extent does Linux support file names longer than 255 ...
The answer, as often, is “it depends”. Looking at the NTFS implementation in particular, it reports a maximum file name length of 255...
Read more >
Windows file paths longer than 255 characters (CrashPlan)
The Windows API imposes a maximum filename length such that a filename, including the file path to get to the file, can't exceed...
Read more >
Windows Path Length Limit Reached - CS IT Support Wiki
That includes the length of the folder names. The limit is supposedly 260 characters for a path name. But, we've seen it actually...
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