File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 46
46
47
47
rename :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
48
48
49
+ rmdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
50
+
49
51
stat :: forall eff. FilePath -> Callback eff Stats -> Eff (fs :: FS | eff) Unit
50
52
51
53
symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
119
121
120
122
rename :: forall eff. FilePath -> FilePath -> Eff (err :: Exception Error, fs :: FS | eff) Unit
121
123
124
+ rmdir :: forall eff. FilePath -> Eff (err :: Exception Error, fs :: FS | eff) Unit
125
+
122
126
stat :: forall eff. FilePath -> Eff (err :: Exception Error, fs :: FS | eff) Stats
123
127
124
128
symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Eff (err :: Exception Error, fs :: FS | eff) Unit
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module Node.FS.Async
11
11
, realpath
12
12
, realpath'
13
13
, unlink
14
+ , rmdir
14
15
, readFile
15
16
, readTextFile
16
17
, writeFile
@@ -53,6 +54,7 @@ foreign import fs "var fs = require('fs');" ::
53
54
, readlink :: Fn2 FilePath (JSCallback FilePath ) Unit
54
55
, realpath :: forall cache . Fn3 FilePath { | cache } (JSCallback FilePath ) Unit
55
56
, unlink :: Fn2 FilePath (JSCallback Unit ) Unit
57
+ , rmdir :: Fn2 FilePath (JSCallback Unit ) Unit
56
58
, readFile :: forall a opts . Fn3 FilePath { | opts } (JSCallback a ) Unit
57
59
, writeFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
58
60
}
@@ -182,6 +184,16 @@ unlink :: forall eff. FilePath
182
184
unlink file cb = return $ runFn2
183
185
fs.unlink file (handleCallback cb)
184
186
187
+ -- |
188
+ -- Deletes a directory.
189
+ --
190
+ rmdir :: forall eff . FilePath
191
+ -> Callback eff Unit
192
+ -> Eff (fs :: FS | eff ) Unit
193
+
194
+ rmdir file cb = return $ runFn2
195
+ fs.rmdir file (handleCallback cb)
196
+
185
197
-- |
186
198
-- Reads the entire contents of a file returning the result as a raw buffer.
187
199
--
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ module Node.FS.Sync
10
10
, realpath
11
11
, realpath'
12
12
, unlink
13
+ , rmdir
13
14
, readFile
14
15
, readTextFile
15
16
, writeFile
@@ -37,6 +38,7 @@ foreign import fs "var fs = require('fs');" ::
37
38
, readlinkSync :: Fn1 FilePath FilePath
38
39
, realpathSync :: forall cache . Fn2 FilePath { | cache } FilePath
39
40
, unlinkSync :: Fn1 FilePath Unit
41
+ , rmdirSync :: Fn1 FilePath Unit
40
42
, readFileSync :: forall a opts . Fn2 FilePath { | opts } a
41
43
, writeFileSync :: forall a opts . Fn3 FilePath a { | opts } Unit
42
44
}
@@ -155,6 +157,15 @@ unlink :: forall eff. FilePath
155
157
unlink file = mkEff $ \_ -> runFn1
156
158
fs.unlinkSync file
157
159
160
+ -- |
161
+ -- Deletes a directory.
162
+ --
163
+ rmdir :: forall eff . FilePath
164
+ -> Eff (fs :: FS , err :: Exception Error | eff ) Unit
165
+
166
+ rmdir file = mkEff $ \_ -> runFn1
167
+ fs.rmdirSync file
168
+
158
169
-- |
159
170
-- Reads the entire contents of a file returning the result as a raw buffer.
160
171
--
You can’t perform that action at this time.
0 commit comments