1import qualified Streamly.Internal.Data.Stream.IsStream as S
2import qualified Streamly.Internal.FileSystem.Handle as IFH
3import qualified Streamly.FileSystem.Handle as FH
4import qualified System.IO as FH
6import Control.Monad.IO.Class (liftIO)
7import Control.Monad.State.Strict (StateT(..), get, put)
8import System.Environment (getArgs)
9import System.IO (IOMode(..))
10import Data.Function ((&))
12newHandle :: StateT (Maybe (FH.Handle, Int)) IO FH.Handle
17 Just (h, i) -> liftIO (FH.hClose h) >> return (i + 1)
18 h <- liftIO $ FH.openFile ("dst-xyz-" ++ show idx ++ ".txt") WriteMode
22-- XXX reduce the input stream to a stream of file names
23-- The fold can return the file name/handle after it is done.
24-- similarly the files can written to directories and we can generate a stream
26splitFile :: FH.Handle -> IO ()
28 S.unfold FH.read inHandle
30 & S.chunksOf2 (180 * 1024 * 1024) newHandle IFH.write2
31 & S.evalStateT (return Nothing) -- generate new handle for each iteration
36 name <- fmap head getArgs
37 src <- FH.openFile name ReadMode
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list