0 | module FS.Posix.Internal
2 | import FS.Internal.Bytes
3 | import IO.Async.Posix
7 | parameters {auto fid : FileDesc a}
9 | {auto has : Has Errno es}
12 | bytes : SnocList ByteString -> Async e es ()
14 | bytes [<bs] = fwritenb fd bs
15 | bytes bss = fwritenb fd (fastConcat $
bss <>> [])
19 | writeAll : Cast r ByteString => List r -> Async e es ()
22 | go : SnocList ByteString -> List r -> Async e es ()
25 | case cast {to = ByteString} x of
27 | bs => go (sx :< bs) xs
32 | writeLines : Cast r ByteString => List r -> Async e es ()
35 | go : SnocList ByteString -> List r -> Async e es ()
38 | case cast {to = ByteString} x of
39 | BS 0 _ => go (sx :< nl) xs
40 | bs => go (sx :< bs :< nl) xs