4 ms·
This doesn't look good: c8 buf [SP_PATH_MAX] = sp_zero; sp_cstr_copy_to_n(path, len, buf, SP_PATH_MAX); since #define SP_PATH_MAX 4096 There should be
by Panzerschrek 5mo ago
This doesn't look good:
c8 buf [SP_PATH_MAX] = sp_zero;
sp_cstr_copy_to_n(path, len, buf, SP_PATH_MAX);
since
#define SP_PATH_MAX 4096
There should be a fallback for very long paths.
- dboon 5mo agoCan you show me a realistic case with a longer path?
- scott01 5mo agoI have email backups from a provider where filenames are extremely long.
- magicalhippo 5mo agoI guess the c8 means you don't plan on supporting Unicode on Windows? If you do, there's the 32768 "character" max path which since Win10 is opt-in without jumping through hoops. https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation https://learn.microsoft.com/en-us/windows/win32/fileio/maxim...
- fc417fc802 5mo agoI'm inclined to agree with you that paths can be arbitrarily long as a matter of principle. However in practice I believe PATH_MAX on most distros defaults to 4096 so if you're going to insist on a hard upper limit it's at least within reason.