File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ foreign import fs "var fs = require('fs');" ::
4444 , stat :: Fn2 FilePath (JSCallback StatsObj ) Unit
4545 , link :: Fn3 FilePath FilePath (JSCallback Unit ) Unit
4646 , symlink :: Fn4 FilePath FilePath String (JSCallback Unit ) Unit
47+ , readlink :: Fn2 FilePath (JSCallback FilePath ) Unit
4748 , readFile :: forall a opts . Fn3 FilePath { | opts } (JSCallback a ) Unit
4849 , writeFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
4950 }
@@ -131,6 +132,16 @@ symlink :: forall eff. FilePath
131132symlink src dest ty cb = return $ runFn4
132133 fs.symlink src dest (show ty) (handleCallback cb)
133134
135+ -- |
136+ -- Reads the value of a symlink.
137+ --
138+ readlink :: forall eff . FilePath
139+ -> Callback eff FilePath
140+ -> Eff (fs :: FS | eff ) Unit
141+
142+ readlink path cb = return $ runFn2
143+ fs.readlink path (handleCallback cb)
144+
134145-- |
135146-- Reads the entire contents of a file returning the result as a raw buffer.
136147--
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ foreign import fs "var fs = require('fs');" ::
2828 , statSync :: Fn1 FilePath StatsObj
2929 , linkSync :: Fn2 FilePath FilePath Unit
3030 , symlinkSync :: Fn3 FilePath FilePath String Unit
31+ , readlinkSync :: Fn1 FilePath FilePath
3132 , readFileSync :: forall a opts . Fn2 FilePath { | opts } a
3233 , writeFileSync :: forall a opts . Fn3 FilePath a { | opts } Unit
3334 }
@@ -108,6 +109,15 @@ symlink :: forall eff. FilePath
108109symlink src dst ty = mkEff $ \_ -> runFn3
109110 fs.symlinkSync src dst (show ty)
110111
112+ -- |
113+ -- Reads the value of a symlink.
114+ --
115+ readlink :: forall eff . FilePath
116+ -> Eff (fs :: FS , err :: Exception Error | eff ) FilePath
117+
118+ readlink path = mkEff $ \_ -> runFn1
119+ fs.readlinkSync path
120+
111121-- |
112122-- Reads the entire contents of a file returning the result as a raw buffer.
113123--
You can’t perform that action at this time.
0 commit comments