6
6
type Callback eff a = Either Error a -> Eff (fs :: FS | eff) Unit
7
7
```
8
8
9
+ Type synonym for callback functions.
10
+
9
11
#### ` rename `
10
12
11
13
``` purescript
12
14
rename :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
13
15
```
14
16
17
+ Renames a file.
18
+
15
19
#### ` truncate `
16
20
17
21
``` purescript
18
22
truncate :: forall eff. FilePath -> Int -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
19
23
```
20
24
25
+ Truncates a file to the specified length.
26
+
21
27
#### ` chown `
22
28
23
29
``` purescript
24
30
chown :: forall eff. FilePath -> Int -> Int -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
25
31
```
26
32
33
+ Changes the ownership of a file.
34
+
27
35
#### ` chmod `
28
36
29
37
``` purescript
30
38
chmod :: forall eff. FilePath -> Perms -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
31
39
```
32
40
41
+ Changes the permissions of a file.
42
+
33
43
#### ` stat `
34
44
35
45
``` purescript
36
46
stat :: forall eff. FilePath -> Callback eff Stats -> Eff (fs :: FS | eff) Unit
37
47
```
38
48
49
+ Gets file statistics.
50
+
39
51
#### ` link `
40
52
41
53
``` purescript
42
54
link :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
43
55
```
44
56
57
+ Creates a link to an existing file.
58
+
45
59
#### ` symlink `
46
60
47
61
``` purescript
48
62
symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
49
63
```
50
64
65
+ Creates a symlink.
66
+
51
67
#### ` readlink `
52
68
53
69
``` purescript
54
70
readlink :: forall eff. FilePath -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
55
71
```
56
72
73
+ Reads the value of a symlink.
74
+
57
75
#### ` realpath `
58
76
59
77
``` purescript
60
78
realpath :: forall eff. FilePath -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
61
79
```
62
80
81
+ Find the canonicalized absolute location for a path.
82
+
63
83
#### ` realpath' `
64
84
65
85
``` purescript
66
86
realpath' :: forall eff cache. FilePath -> { | cache } -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
67
87
```
68
88
89
+ Find the canonicalized absolute location for a path using a cache object
90
+ for already resolved paths.
91
+
69
92
#### ` unlink `
70
93
71
94
``` purescript
72
95
unlink :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
73
96
```
74
97
98
+ Deletes a file.
99
+
75
100
#### ` rmdir `
76
101
77
102
``` purescript
78
103
rmdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
79
104
```
80
105
106
+ Deletes a directory.
107
+
81
108
#### ` mkdir `
82
109
83
110
``` purescript
84
111
mkdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
85
112
```
86
113
114
+ Makes a new directory.
115
+
87
116
#### ` mkdir' `
88
117
89
118
``` purescript
90
119
mkdir' :: forall eff. FilePath -> Perms -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
91
120
```
92
121
122
+ Makes a new directory with the specified permissions.
123
+
93
124
#### ` readdir `
94
125
95
126
``` purescript
96
127
readdir :: forall eff. FilePath -> Callback eff (Array FilePath) -> Eff (fs :: FS | eff) Unit
97
128
```
98
129
130
+ Reads the contents of a directory.
131
+
99
132
#### ` utimes `
100
133
101
134
``` purescript
102
135
utimes :: forall eff. FilePath -> Date -> Date -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
103
136
```
104
137
138
+ Sets the accessed and modified times for the specified file.
139
+
105
140
#### ` readFile `
106
141
107
142
``` purescript
108
143
readFile :: forall eff. FilePath -> Callback (buffer :: BUFFER | eff) Buffer -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
109
144
```
110
145
146
+ Reads the entire contents of a file returning the result as a raw buffer.
147
+
111
148
#### ` readTextFile `
112
149
113
150
``` purescript
114
151
readTextFile :: forall eff. Encoding -> FilePath -> Callback eff String -> Eff (fs :: FS | eff) Unit
115
152
```
116
153
154
+ Reads the entire contents of a text file with the specified encoding.
155
+
117
156
#### ` writeFile `
118
157
119
158
``` purescript
120
159
writeFile :: forall eff. FilePath -> Buffer -> Callback (buffer :: BUFFER | eff) Unit -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
121
160
```
122
161
162
+ Writes a buffer to a file.
163
+
123
164
#### ` writeTextFile `
124
165
125
166
``` purescript
126
167
writeTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
127
168
```
128
169
170
+ Writes text to a file using the specified encoding.
171
+
129
172
#### ` appendFile `
130
173
131
174
``` purescript
132
175
appendFile :: forall eff. FilePath -> Buffer -> Callback (buffer :: BUFFER | eff) Unit -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
133
176
```
134
177
178
+ Appends the contents of a buffer to a file.
179
+
135
180
#### ` appendTextFile `
136
181
137
182
``` purescript
138
183
appendTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
139
184
```
140
185
186
+ Appends text to a file using the specified encoding.
187
+
141
188
#### ` exists `
142
189
143
190
``` purescript
144
191
exists :: forall eff. FilePath -> (Boolean -> Eff (fs :: FS | eff) Unit) -> Eff (fs :: FS | eff) Unit
145
192
```
146
193
194
+ Check if the path exists.
195
+
147
196
#### ` fdOpen `
148
197
149
198
``` purescript
@@ -156,28 +205,43 @@ fdOpen :: forall eff. FilePath -> FileFlags -> Maybe FileMode -> Callback eff Fi
156
205
fdRead :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
157
206
```
158
207
208
+ Read from a file asynchronously. See the [ Node Documentation] ( https://nodejs.org/api/fs.html#fs_fs_read_fd_buffer_offset_length_position_callback )
209
+ for details.
210
+
159
211
#### ` fdNext `
160
212
161
213
``` purescript
162
214
fdNext :: forall eff. FileDescriptor -> Buffer -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
163
215
```
164
216
217
+ Convenience function to fill the whole buffer from the current
218
+ file position.
219
+
165
220
#### ` fdWrite `
166
221
167
222
``` purescript
168
223
fdWrite :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
169
224
```
170
225
226
+ Write to a file asynchronously. See the [ Node Documentation] ( https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback )
227
+ for details.
228
+
171
229
#### ` fdAppend `
172
230
173
231
``` purescript
174
232
fdAppend :: forall eff. FileDescriptor -> Buffer -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
175
233
```
176
234
235
+ Convenience function to append the whole buffer to the current
236
+ file position.
237
+
177
238
#### ` fdClose `
178
239
179
240
``` purescript
180
241
fdClose :: forall eff. FileDescriptor -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
181
242
```
182
243
244
+ Close a file asynchronously. See the [ Node Documentation] ( https://nodejs.org/api/fs.html#fs_fs_close_fd_callback )
245
+ for details.
246
+
183
247
0 commit comments