1import qualified Streamly.Internal.Prelude as S
2import qualified Streamly.Data.Fold as FL
3-- import qualified Streamly.Memory.Array as A
4import qualified Streamly.Internal.Memory.ArrayStream as AS
5import qualified Streamly.Internal.FileSystem.Handle as IFH
6import qualified Streamly.FileSystem.Handle as FH
7import qualified System.IO as FH
8-- import qualified Streamly.FileSystem.FD as FH
9-- import qualified Streamly.Data.Unicode.Stream as US
11import Control.Monad.IO.Class (liftIO)
12import Control.Monad.State.Strict (StateT(..), get, put)
14import System.Environment (getArgs)
15import System.IO (IOMode(..), hSeek, SeekMode(..))
16import Data.Function ((&))
18newHandle :: StateT (Maybe (FH.Handle, Int)) IO FH.Handle
23 Just (h, i) -> liftIO (FH.hClose h) >> return (i + 1)
24 h <- liftIO $ FH.openFile ("dst-xyz-" ++ show idx ++ ".txt") WriteMode
28-- XXX reduce the input stream to a stream of file names
29-- The fold can return the file name/handle after it is done.
30-- similarly the files can written to directories and we can generate a stream
32splitFile :: FH.Handle -> IO ()
34 S.unfold FH.read inHandle
36 & S.chunksOf2 (180 * 1024 * 1024) newHandle IFH.write2
37 & S.evalStateT Nothing -- generate new handle for each iteration
42 name <- fmap head getArgs
43 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