You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to clone the project into Idea on Windows, but the cloning fails because four filenames are too long. I then try to clone on Linux and it succeeds without problems. I know Windows has a character limit on filenames.
Is it possible to get these four filenames shortened for Windows support?
Error log
Clone failed
Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.0/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.1/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.2/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
Filename too long unable to create file generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.3/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
Filename too long unable to checkout working tree warning
that's a surprising problem... only Svante (who is traveling currently) knows if these can be renamed but the "test-reference" indicates that it's something generated and to be compared with future results of the code generation...
i tried it with git-for-windows and apparently it depends on the total length of the path:
"git clone" inside "/c/cygwin/home/ms/lo" is successful
"git clone" inside "/c/cygwin/home/ms/lo/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" fails with this error
is it possible to configure Idea to store it in a shorter path?
No, that's a known problem on Windows with filenames and folders (in combination) should not be longer than 255 characters... and this although NTFS is able to handle even more characters... 🙈
is it possible to configure Idea to store it in a shorter path?
subst G: c:\my\path\to\git\odftoolkit\
might help to shorten the links to a minimum in my experience. (so creating another (virtual) partition linking to the git folder)
Well, this subst'ing commands needs to be typed every startup as windows forgets such stuff sadly.
so far it seems quite correct and reasonable to me! :-)
The complete path (including the default odftoolkit repo name counts 232 character but strangely my directory path counts 29 characters and no error for me!
I even did a test with a loooong directory for cloning:
135 character is the directory and the total path length of the above file 367 characters:
E:\dev\012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789\odftoolkit\generator\schema2template\src\test\resources\test-reference\odf\graphml\odf-schema-1.3_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
I suggest Dennis approach above use "subst" or a smaller director or a Windows update ;-)
Guess there is no final fix available and the other changeable parts are more complex to change from my perspective!
Nevertheless, thanks for pointing this out! Now we have a reference for this problem and work-around!
Activity
mistmist commentedon May 10, 2023
that's a surprising problem... only Svante (who is traveling currently) knows if these can be renamed but the "test-reference" indicates that it's something generated and to be compared with future results of the code generation...
i tried it with git-for-windows and apparently it depends on the total length of the path:
"git clone" inside "/c/cygwin/home/ms/lo" is successful
"git clone" inside "/c/cygwin/home/ms/lo/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" fails with this error
is it possible to configure Idea to store it in a shorter path?
dennisroczek commentedon May 10, 2023
No, that's a known problem on Windows with filenames and folders (in combination) should not be longer than 255 characters... and this although NTFS is able to handle even more characters... 🙈
subst G: c:\my\path\to\git\odftoolkit\might help to shorten the links to a minimum in my experience. (so creating another (virtual) partition linking to the git folder)
Well, this subst'ing commands needs to be typed every startup as windows forgets such stuff sadly.
svanteschubert commentedon May 24, 2023
Interesting, I was not aware that such long file name exists (and as developers usually say - works on my laptop) ;-)
But honestly, first this long path including the file name to a test reference file exists:
https://github.com/tdf/odftoolkit/blob/master/generator/schema2template/src/test/resources/test-reference/odf/graphml/odf-schema-1.3/_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
this generated from a very special case of the RelaxNG XML Grammar, where a single element might have 7 different names:
http://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-schema-rng.html#8705
If there is such choice of names for the same entitiy of element - same (sub)content - the unique name is equal to the concatenation of the choices, see
https://github.com/tdf/odftoolkit/blob/master/generator/schema2template/src/main/java/schema2template/grammar/TinkerPopGraph.java#L75
so far it seems quite correct and reasonable to me! :-)
The complete path (including the default odftoolkit repo name counts 232 character but strangely my directory path counts 29 characters and no error for me!
I even did a test with a loooong directory for cloning:
135 character is the directory and the total path length of the above file 367 characters:
E:\dev\012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789012345789\odftoolkit\generator\schema2template\src\test\resources\test-reference\odf\graphml\odf-schema-1.3_text_page-count_text_paragraph-count_text_word-count_text_character-count_text_table-count_text_image-count_text_object-count.graphml
So I took a look and if you have a Windows docu:
"Windows before Windows 10 version 1607, the maximum length for a path is MAX_PATH, which is defined as 260 characters.", see https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation
I suggest Dennis approach above use "subst" or a smaller director or a Windows update ;-)
Guess there is no final fix available and the other changeable parts are more complex to change from my perspective!
Nevertheless, thanks for pointing this out! Now we have a reference for this problem and work-around!