File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 28
28
29
29
### Values
30
30
31
+ appendFile :: forall eff. FilePath -> Buffer -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
32
+
33
+ appendTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
34
+
31
35
chmod :: forall eff. FilePath -> Number -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
32
36
33
37
chown :: forall eff. FilePath -> Number -> Number -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
111
115
112
116
### Values
113
117
118
+ appendFile :: forall eff. FilePath -> Buffer -> Eff (err :: Exception Error, fs :: FS | eff) Unit
119
+
120
+ appendTextFile :: forall eff. Encoding -> FilePath -> String -> Eff (err :: Exception Error, fs :: FS | eff) Unit
121
+
114
122
chmod :: forall eff. FilePath -> Number -> Eff (err :: Exception Error, fs :: FS | eff) Unit
115
123
116
124
chown :: forall eff. FilePath -> Number -> Number -> Eff (err :: Exception Error, fs :: FS | eff) Unit
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ module Node.FS.Async
20
20
, readTextFile
21
21
, writeFile
22
22
, writeTextFile
23
+ , appendFile
24
+ , appendTextFile
23
25
) where
24
26
25
27
import Control.Monad.Eff
@@ -65,6 +67,7 @@ foreign import fs "var fs = require('fs');" ::
65
67
, utimes :: Fn4 FilePath Number Number (JSCallback Unit ) Unit
66
68
, readFile :: forall a opts . Fn3 FilePath { | opts } (JSCallback a ) Unit
67
69
, writeFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
70
+ , appendFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
68
71
}
69
72
70
73
-- |
@@ -290,3 +293,26 @@ writeTextFile :: forall eff. Encoding
290
293
291
294
writeTextFile encoding file buff cb = return $ runFn4
292
295
fs.writeFile file buff { encoding: show encoding } (handleCallback cb)
296
+
297
+ -- |
298
+ -- Appends the contents of a buffer to a file.
299
+ --
300
+ appendFile :: forall eff . FilePath
301
+ -> Buffer
302
+ -> Callback eff Unit
303
+ -> Eff (fs :: FS | eff ) Unit
304
+
305
+ appendFile file buff cb = return $ runFn4
306
+ fs.appendFile file buff {} (handleCallback cb)
307
+
308
+ -- |
309
+ -- Appends text to a file using the specified encoding.
310
+ --
311
+ appendTextFile :: forall eff . Encoding
312
+ -> FilePath
313
+ -> String
314
+ -> Callback eff Unit
315
+ -> Eff (fs :: FS | eff ) Unit
316
+
317
+ appendTextFile encoding file buff cb = return $ runFn4
318
+ fs.appendFile file buff { encoding: show encoding } (handleCallback cb)
Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ module Node.FS.Sync
19
19
, readTextFile
20
20
, writeFile
21
21
, writeTextFile
22
+ , appendFile
23
+ , appendTextFile
22
24
) where
23
25
24
26
import Control.Monad.Eff
@@ -49,6 +51,7 @@ foreign import fs "var fs = require('fs');" ::
49
51
, utimesSync :: Fn3 FilePath Number Number Unit
50
52
, readFileSync :: forall a opts . Fn2 FilePath { | opts } a
51
53
, writeFileSync :: forall a opts . Fn3 FilePath a { | opts } Unit
54
+ , appendFileSync :: forall a opts . Fn3 FilePath a { | opts } Unit
52
55
}
53
56
54
57
foreign import mkEff
@@ -253,3 +256,24 @@ writeTextFile :: forall eff. Encoding
253
256
254
257
writeTextFile encoding file buff = mkEff $ \_ -> runFn3
255
258
fs.writeFileSync file buff { encoding: show encoding }
259
+
260
+ -- |
261
+ -- Appends the contents of a buffer to a file.
262
+ --
263
+ appendFile :: forall eff . FilePath
264
+ -> Buffer
265
+ -> Eff (fs :: FS , err :: Exception Error | eff ) Unit
266
+
267
+ appendFile file buff = mkEff $ \_ -> runFn3
268
+ fs.appendFileSync file buff {}
269
+
270
+ -- |
271
+ -- Appends text to a file using the specified encoding.
272
+ --
273
+ appendTextFile :: forall eff . Encoding
274
+ -> FilePath
275
+ -> String
276
+ -> Eff (fs :: FS , err :: Exception Error | eff ) Unit
277
+
278
+ appendTextFile encoding file buff = mkEff $ \_ -> runFn3
279
+ fs.appendFileSync file buff { encoding: show encoding }
You can’t perform that action at this time.
0 commit comments