Thank you, @Daeraxa. I was just looking at the source code.
While I understand the reasoning, I don't agree with it because
- It imposes a limit on the platform instead of checking the platform's limits
- It doesn't solve the root problem; path limit errors will still occur
- It silently modifies the user's data
I've read the several forum arguments about export fidelity, and I understand this is a hard problem when supporting multiple platforms, no "note" standard, etc.
Path length limit
I agree there's a path limit per platform. But the Windows MAX_PATH limit of 255 isn't generally valid anymore. 32,767 characters is the norm. Maximum Path Length Limitation - Win32 apps | Microsoft Docs
I know it's more work than using a hard 50 character limit, but wouldn't there be value in checking the running platform's capabilities? Check the installed platform's path limit and only truncate if exceeding that limit. The
makeDirPath method could perform this check, or move the functionality to
JEX is Joplin's high-fidelity export/import format. Understood. The point I'm making here isn't fidelity, but user-friendliness. If an export is going to change user data, which the 50 character limit does, then the user should be informed according to the Principle of Least Surprise.
I may write this up as a formal feature request (or work on a pull request, which is what I should do, right?). Basically, the app should keep track of when paths are truncated during export and provide a report of those changes.
When I perform a Markdown export of my Joplin notebooks, I can't delete the resulting folder using File Explorer. I must use the Command shell and run
rmdir [dir] /s /q. While this is arguably an OS issue, it's still being caused by the Joplin truncation. Only the truncated folders have a problem. Note: I think this may be due to Joplin not trimming the folder name, resulting in trailing spaces.
I hope this discussion helps provide a user's point of view on problems with truncating folder/file names on export, as well as respecting the development challenge in improving those exports. A report of truncated paths would go a long way toward an improved user experience.