avoid parsing lock files as transfer files

This seems to happen with kqueue, not inotify. The newly added lck file
triggers an add event and was then parsed as a transfer file.
This commit is contained in:
Joey Hess 2012-07-17 17:26:53 -04:00
parent b702bae950
commit d53f70e203

View file

@ -144,8 +144,9 @@ transferLockFile infofile = let (d,f) = splitFileName infofile in
{- Parses a transfer information filename to a Transfer. -}
parseTransferFile :: FilePath -> Maybe Transfer
parseTransferFile file =
case drop (length bits - 3) bits of
parseTransferFile file
| "lck." `isPrefixOf` (takeFileName file) = Nothing
| otherwise = case drop (length bits - 3) bits of
[direction, u, key] -> Transfer
<$> readDirection direction
<*> pure (toUUID u)