File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ import Node.Encoding
1111
1212main = do
1313
14+ A .exists " examples\\ Test.purs" $ \e ->
15+ trace $ " Test.purs exists? " ++ show e
16+
1417 file <- S .readTextFile UTF8 " examples\\ Test.purs"
1518 trace " \n\n readTextFile sync result:"
1619 trace $ file
Original file line number Diff line number Diff line change @@ -326,3 +326,12 @@ appendTextFile :: forall eff. Encoding
326326
327327appendTextFile encoding file buff cb = mkEff $ \_ -> runFn4
328328 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