OpenPype icon indicating copy to clipboard operation
OpenPype copied to clipboard

Validate subset name length

Open tokejepsen opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe.

We had an issue with our TVPaint render pass subset names getting to 92 character because they are a combination of the render layer name and the render pass name.

Describe the solution you'd like

A global validator for subset name length, that can be configured by the studio.

[cuID:OP-2067]

tokejepsen avatar Nov 29 '21 10:11 tokejepsen

Have you ran into this repeatedly? I can't help it but think that validating this is a bit of an overkill. But would be trivial to add of course.

mkolar avatar Jun 07 '22 22:06 mkolar

It was a trickier issue to track down so a validator to explain this might be good for the future.

tokejepsen avatar Jun 12 '22 18:06 tokejepsen

This only really is an issue on Windows I suppose? Plus only problematic too if the full path of a file goes over the old Windows character limit for paths, the MAX PATH of 256 characters. (Actually 260, but that includes C:\ and a <NUL> at the end).

However, since an update in Win 10 you should be able to override a setting to allow it up to approximately 32,767 characters.

Do note that even though that setting can be enabled I've still seen some issues with apps every now and then when the character or worse, with network configurations. E.g. samba shares also seem to limit the path length although that post has been updated 6+ years ago so might be redundant nowadays.

According to this it seems that linux has a 255 character filename limit - as far as I'm aware that's filename, not full filepath. It's a filename length limit that many file systems seem to match however as can also be seen there almost none of them set limits on the full file path. This IBM page describes it nicely:

On Linux: The maximum length for a file name is 255 bytes. The maximum combined length of both the file name and path name is 4096 bytes. This length matches the PATH_MAX that is supported by the operating system. The Unicode representation of a character can occupy several bytes, so the maximum number of characters that comprises a path and file name can vary. The actual limitation is the number of bytes in the path and file components, which might correspond to an equal number of characters.

BigRoy avatar Jul 01 '23 14:07 BigRoy

This only really is an issue on Windows I suppose?

Yeah, I guess so. It was a hard issue to track down so any validator to either inform or warn users would be good to have.

tokejepsen avatar Jul 03 '23 07:07 tokejepsen