File tree 2 files changed +12
-0
lines changed 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ import Node.Encoding
11
11
12
12
main = do
13
13
14
+ A .exists " examples\\ Test.purs" $ \e ->
15
+ trace $ " Test.purs exists? " ++ show e
16
+
14
17
file <- S .readTextFile UTF8 " examples\\ Test.purs"
15
18
trace " \n\n readTextFile sync result:"
16
19
trace $ file
Original file line number Diff line number Diff line change @@ -326,3 +326,12 @@ appendTextFile :: forall eff. Encoding
326
326
327
327
appendTextFile encoding file buff cb = mkEff $ \_ -> runFn4
328
328
fs.appendFile file buff { encoding: show encoding } (handleCallback cb)
329
+
330
+ -- |
331
+ -- Check if the path exists.
332
+ --
333
+ exists :: forall eff . FilePath
334
+ -> (Boolean -> Eff eff Unit )
335
+ -> Eff (fs :: FS | eff ) Unit
336
+ exists file cb = mkEff $ \_ -> runFn2
337
+ fs.exists file $ \b -> runPure (unsafeInterleaveEff (cb b))
You can’t perform that action at this time.
0 commit comments