WriteOncePersistentDict shouldn't create a file with name length > NAME_MAX
Usually NAME_MAX is 256 chars, but I've used file systems where it's 143 chars which can be easily reached.
Usually NAME_MAX is 256 chars, but I've used file systems where it's 143 chars which can be easily reached.
Thanks for the report.
Here's an example:
.cache/pytools/pdict-v2-loopy-schedule-cache-v4-2018.1-islpy2018.2-cgen2018.1-99b4600f207f3851e5bd7ab03163bc8d20da8613-v0-py3.7.3.candidate.1/c20049d4721825bb4be8c8fb85f25218c02f057ea1fa7b971d19fe6a2be64172/contents
That's 215 total plus the path to the home directory (MAX_PATH
? https://stackoverflow.com/questions/265769/maximum-filename-length-in-ntfs-windows-xp-and-windows-vista), and 126 in the longest component (Is that what NAME_MAX
is talking about?) The major opportunities for shortening are the names loopy-schedule-cache
, the git revision, and the hash. If we shorten each by a bit, I think we should be in the clear.
Did you see this as an actual failure, or is this more hypothetical?
Yes, the longest component (which is 126 in the example above) should be less than NAME_MAX and the full path (which is 215 in the example above) should be less than MAX_PATH.
It's hypothetical. Not an actual failure. My file system right now has NAME_MAX 255 and the maximum component is 136 in my cache dir.
MAX_PATH is usually 4096 in linux
On Linux, this can be checked using,
getconf NAME_MAX /
getconf PATH_MAX /