2-- Module : Streamly.FileSystem.File
3-- Copyright : (c) 2019 Composewell Technologies
6-- Maintainer : streamly@composewell.com
7-- Stability : pre-release
10-- Warning\: The API of this module is subject to change in future releases.
11-- Especially the type for representing paths may change from 'FilePath' to
14-- Read and write streams and arrays to and from files specified by their paths
15-- in the file system. Unlike the handle based APIs which can have a read/write
16-- session consisting of multiple reads and writes to the handle, these APIs
17-- are one shot read or write APIs. These APIs open the file handle, perform
18-- the requested operation and close the handle. These are safer compared to
19-- the handle based APIs as there is no possibility of a file descriptor
22-- >>> import qualified Streamly.FileSystem.File as File
24module Streamly.FileSystem.File
27 -- | Stream data to or from a file or device sequentially. When reading,
28 -- the stream is lazy and generated on-demand as the consumer consumes it.
29 -- Read IO requests to the IO device are performed in chunks limited to a
30 -- maximum size of 32KiB, this is referred to as @defaultChunkSize@ in the
31 -- documentation. One IO request may or may not read the full
32 -- chunk. If the whole stream is not consumed, it is possible that we may
33 -- read slightly more from the IO device than what the consumer needed.
34 -- Unless specified otherwise in the API, writes are collected into chunks
35 -- of @defaultChunkSize@ before they are written to the IO device.
37 -- Streaming APIs work for all kind of devices, seekable or non-seekable;
38 -- including disks, files, memory devices, terminals, pipes, sockets and
39 -- fifos. While random access APIs work only for files or devices that have
40 -- random access or seek capability for example disks, memory devices.
41 -- Devices like terminals, pipes, sockets and fifos do not have random
44 -- ** File IO Using Handle
59import Streamly.Internal.FileSystem.File
60import Prelude hiding (read)
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