From c76df7f159262ddbe891c465a936033a55a8df09 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 10 May 2016 00:28:04 +0200 Subject: [PATCH] HPath.IO: small cleanup --- src/HPath/IO.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/HPath/IO.hs b/src/HPath/IO.hs index e4c425f..6955461 100644 --- a/src/HPath/IO.hs +++ b/src/HPath/IO.hs @@ -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