HPath.IO: small cleanup

This commit is contained in:
Julian Ospald 2016-05-10 00:28:04 +02:00
parent 613754c58f
commit c76df7f159
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 4 additions and 4 deletions

View File

@ -393,13 +393,13 @@ _copyFile :: [SPDF.Flags]
-> IO ()
_copyFile sflags dflags from to
=
-- TODO: add sendfile support
withAbsPath to $ \to' -> withAbsPath from $ \from' ->
void $ fallbackCopy from' to'
-- TODO: add sendfile support
void $ readWriteCopy (fromAbs from) (fromAbs to)
where
-- low-level copy operation utilizing read(2)/write(2)
-- in case `sendFileCopy` fails/is unsupported
fallbackCopy source dest =
readWriteCopy :: ByteString -> ByteString -> IO Int
readWriteCopy source dest =
bracket (SPDT.openFd source SPI.ReadOnly sflags Nothing)
SPI.closeFd
$ \sfd -> do