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:
parent
b702bae950
commit
d53f70e203
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue