remote.foo.annex-ignore, as documented.
* Support git-annex copy/move --from-anywhere --to remote.
* sync: Fix locking problems during merge when annex.pidlock is set.
+ * Avoid a problem with temp file names ending in "." on certian
+ filesystems that have problems with such filenames.
-- Joey Hess <id@joeyh.name> Thu, 30 Nov 2023 14:48:12 -0400
- to help identify what call was responsible.
-}
openTmpFileIn :: FilePath -> String -> IO (FilePath, Handle)
-openTmpFileIn dir template = openTempFile dir template
- `catchIO` decoraterrror
+openTmpFileIn dir template = do
+ liftIO $ print ("openTmpFileIn", dir, template)
+ openTempFile dir template
+ `catchIO` decoraterrror
where
decoraterrror e = throwM $
let loc = ioeGetLocation e ++ " template " ++ template
-}
relatedTemplate :: FilePath -> FilePath
relatedTemplate f
- | len > 20 = truncateFilePath (len - 20) f
+ | len > 20 =
+ {- Some filesystems like FAT have issues with filenames
+ - ending in ".", so avoid truncating a filename to end
+ - that way. -}
+ reverse $ dropWhile (== '.') $ reverse $
+ truncateFilePath (len - 20) f
| otherwise = f
where
len = length f
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2023-12-05T16:16:35Z"
+ content="""
+This is EINVAL from probably open(2) or something like that.
+
+ EINVAL The final component ("basename") of pathname is invalid (e.g.,
+ it contains characters not permitted by the underlying filesysâ
+ tem).
+
+The problem is likely the ending ".", since FAT and probably other Microsoft filesystems
+don't allow that, and/or have other strange behavior like silently removing that.
+
+Changed the code to avoid this.
+"""]]