Is there a maximum length for file names?

Is there a maximum length for file names?

mslosar
Advisor Advisor
2,608 Views
2 Replies
Message 1 of 3

Is there a maximum length for file names?

mslosar
Advisor
Advisor

We just had someone discover what i'd call a relative oddity.

 

I have an add-in that is half based on the API help file's export your BOM to a csv file example. In short, the add-in saves the BOM to the CSV file and reads the CSV file back into memory and parses it out and reformats it for our ERP system. It's has it's own quirks, but it works fine.

 

Our file names for the assemblies we run this on are generally less than 20 characters long. The norm is actually 15 characters. Hasn't caused an issue - until now.

 

We're working with a new naming system that generates assemblies that can get file names upwards of 40ish characters in length. To me, while a good deal longer, did not seem to be any big deal. But what we discovered today is that as long as the filename itself (the name part of name.iam) is 28 characters or less, it works fine. Once it hits 29 it fails to work, but does not generate an error. 

 

To get files into our ERP, the only method available is to write text files the system can read and using a utility IT created to read those files into the system. Regardless of the filename, the export to a generically named csv file works 100% of the time. It's the reading it back in that fails. 

 

For the life of me, i cannot think of a reason why the length of the filename would impact this at all. I mean, if my filename was 300 characters or something, i'd get it. But 28?

 

Anyone have any ideas?

0 Likes
Accepted solutions (1)
2,609 Views
2 Replies
Replies (2)
Message 2 of 3

Sergio.D.Suárez
Mentor
Mentor

Hi, I think the limitation is not in the length of the file name, but in the file path. More precisely in the "Fullfilename". Maybe your file name has 40 characters only, but at some point there are many subfolders to access the specific file name.This increases the full name of the file path, and here it can present problems, not only in the add-in even by copying and pasting folders as it would be a limitation of Windows. It could also generate problems I guess in the pack and go.
As far as possible I try to avoid long file names, I use to name them first their code, and then a brief description, for example if the part were

526ASV_ Main Flange Bracket
I use

526ASV_ MainFlBr
It's just an opinion, I hope you can solve it. Regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 3 of 3

mslosar
Advisor
Advisor
Accepted solution

I actually moved it all over the folder structure thinking that might be the issue, it wasn't.

 

I hadn't posted the code because with everything it does parsing the csv file it's like 1000 lines long which seemed excessive.

 

Turns out there was a reference to the filename buried within all that - just ONE reference in sort of a backhanded way which didn't turn up on a search for filename (it was displayname!). Turns out that where it was being used had a field length limit that these new files blow by. Edited it to a new method to obtain the same info and it works again.

 

Thanks for the help, though. If only the person who reported it had mentioned their issues with this field when saying the thing didn't work, it would have cut my time down from 3 hours to 15-20 minutes 🙂

0 Likes