prevent relatedTemplate from truncating a filename to end in "."
authorJoey Hess <joeyh@joeyh.name>
Tue, 5 Dec 2023 16:38:14 +0000 (12:38 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 5 Dec 2023 16:38:14 +0000 (12:38 -0400)
commita6eb7d73398fc1729faec663c1822023e540643b
treec6c2c5bdb6646e56d19bc6bc0a52f7df63563ad9
parent9aa53212a9fd4b8640dc9d1615151fdcd7672fdc
prevent relatedTemplate from truncating a filename to end in "."

Avoid a problem with temp file names ending in "." on certian filesystems
that have problems with such filenames.

relatedTemplate is quite an ugly hack really; since it doesn't know the max
filename length of the filesystem it can only assume that the filename is
max allowed length. When given the input "lh.aparc.DKTatlas.annot", it
wants to reserve 20 characters for tempfile so it truncates to "lh.". That
ending period is apparently a problem on some filesystem (FAT eats it, but
does not throw EINVAL; ntfs does not seem bothered by it, I don't know what
FUSE filesystem the bug reporter was really using).

Sponsored-by: Brett Eisenberg on Patreon
CHANGELOG
Utility/Tmp.hs
doc/bugs/Invalid_argument_saving_FreeSurfer_file_on_NTFS.mdwn
doc/bugs/Invalid_argument_saving_FreeSurfer_file_on_NTFS/comment_1_181a319138cc10742bc8676d77e8a614._comment [new file with mode: 0644]