sendFile :: Session -- ^ Session to use
         -> Integer -- ^ File mode (e.g. 0o777, note the octal notation)
         -> String  -- ^ Source path
         -> String  -- ^ Target path
         -> SimpleSSH Integer
sendFile session mode source target = do
  liftIOEither $ do
    sourceC <- newCString source
    targetC <- newCString target
    let modeC = fromInteger mode

    res <- liftEitherCFree freeEitherCountC readCount $ sendFileC session modeC sourceC targetC

    free sourceC
    free targetC

    return res

-- | Close a session.
sendFile :: Session -- ^ Session to use
         -> Integer -- ^ File mode (e.g. 0o777, note the octal notation)
         -> String  -- ^ Source path
         -> String  -- ^ Target path
         -> SimpleSSH Integer
sendFile session mode source target = do
  liftIOEither $ do
    sourceC <- newCString source
    targetC <- newCString target
    let modeC = fromInteger mode

    res <- liftEitherCFree freeEitherCountC readCount $ sendFileC session modeC sourceC targetC

    free sourceC
    free targetC

    return res

-- | Close a session.
sendFile session mode source target = do
  liftIOEither $ do
    sourceC <- newCString source
    targetC <- newCString target
    let modeC = fromInteger mode

    res <- liftEitherCFree freeEitherCountC readCount $ sendFileC session modeC sourceC targetC

    free sourceC
    free targetC

    return res

-- | Close a session.