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 issueHello,
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:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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
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.
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.