66type Callback eff a = Either Error a -> Eff (fs :: FS | eff) Unit
77```
88
9+ Type synonym for callback functions.
10+
911#### ` rename `
1012
1113``` purescript
1214rename :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
1315```
1416
17+ Renames a file.
18+
1519#### ` truncate `
1620
1721``` purescript
1822truncate :: forall eff. FilePath -> Int -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
1923```
2024
25+ Truncates a file to the specified length.
26+
2127#### ` chown `
2228
2329``` purescript
2430chown :: forall eff. FilePath -> Int -> Int -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
2531```
2632
33+ Changes the ownership of a file.
34+
2735#### ` chmod `
2836
2937``` purescript
3038chmod :: forall eff. FilePath -> Perms -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
3139```
3240
41+ Changes the permissions of a file.
42+
3343#### ` stat `
3444
3545``` purescript
3646stat :: forall eff. FilePath -> Callback eff Stats -> Eff (fs :: FS | eff) Unit
3747```
3848
49+ Gets file statistics.
50+
3951#### ` link `
4052
4153``` purescript
4254link :: forall eff. FilePath -> FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
4355```
4456
57+ Creates a link to an existing file.
58+
4559#### ` symlink `
4660
4761``` purescript
4862symlink :: forall eff. FilePath -> FilePath -> SymlinkType -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
4963```
5064
65+ Creates a symlink.
66+
5167#### ` readlink `
5268
5369``` purescript
5470readlink :: forall eff. FilePath -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
5571```
5672
73+ Reads the value of a symlink.
74+
5775#### ` realpath `
5876
5977``` purescript
6078realpath :: forall eff. FilePath -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
6179```
6280
81+ Find the canonicalized absolute location for a path.
82+
6383#### ` realpath' `
6484
6585``` purescript
6686realpath' :: forall eff cache. FilePath -> { | cache } -> Callback eff FilePath -> Eff (fs :: FS | eff) Unit
6787```
6888
89+ Find the canonicalized absolute location for a path using a cache object
90+ for already resolved paths.
91+
6992#### ` unlink `
7093
7194``` purescript
7295unlink :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
7396```
7497
98+ Deletes a file.
99+
75100#### ` rmdir `
76101
77102``` purescript
78103rmdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
79104```
80105
106+ Deletes a directory.
107+
81108#### ` mkdir `
82109
83110``` purescript
84111mkdir :: forall eff. FilePath -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
85112```
86113
114+ Makes a new directory.
115+
87116#### ` mkdir' `
88117
89118``` purescript
90119mkdir' :: forall eff. FilePath -> Perms -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
91120```
92121
122+ Makes a new directory with the specified permissions.
123+
93124#### ` readdir `
94125
95126``` purescript
96127readdir :: forall eff. FilePath -> Callback eff (Array FilePath) -> Eff (fs :: FS | eff) Unit
97128```
98129
130+ Reads the contents of a directory.
131+
99132#### ` utimes `
100133
101134``` purescript
102135utimes :: forall eff. FilePath -> Date -> Date -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
103136```
104137
138+ Sets the accessed and modified times for the specified file.
139+
105140#### ` readFile `
106141
107142``` purescript
108143readFile :: forall eff. FilePath -> Callback (buffer :: BUFFER | eff) Buffer -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
109144```
110145
146+ Reads the entire contents of a file returning the result as a raw buffer.
147+
111148#### ` readTextFile `
112149
113150``` purescript
114151readTextFile :: forall eff. Encoding -> FilePath -> Callback eff String -> Eff (fs :: FS | eff) Unit
115152```
116153
154+ Reads the entire contents of a text file with the specified encoding.
155+
117156#### ` writeFile `
118157
119158``` purescript
120159writeFile :: forall eff. FilePath -> Buffer -> Callback (buffer :: BUFFER | eff) Unit -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
121160```
122161
162+ Writes a buffer to a file.
163+
123164#### ` writeTextFile `
124165
125166``` purescript
126167writeTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
127168```
128169
170+ Writes text to a file using the specified encoding.
171+
129172#### ` appendFile `
130173
131174``` purescript
132175appendFile :: forall eff. FilePath -> Buffer -> Callback (buffer :: BUFFER | eff) Unit -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
133176```
134177
178+ Appends the contents of a buffer to a file.
179+
135180#### ` appendTextFile `
136181
137182``` purescript
138183appendTextFile :: forall eff. Encoding -> FilePath -> String -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
139184```
140185
186+ Appends text to a file using the specified encoding.
187+
141188#### ` exists `
142189
143190``` purescript
144191exists :: forall eff. FilePath -> (Boolean -> Eff (fs :: FS | eff) Unit) -> Eff (fs :: FS | eff) Unit
145192```
146193
194+ Check if the path exists.
195+
147196#### ` fdOpen `
148197
149198``` purescript
@@ -156,28 +205,43 @@ fdOpen :: forall eff. FilePath -> FileFlags -> Maybe FileMode -> Callback eff Fi
156205fdRead :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
157206```
158207
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+
159211#### ` fdNext `
160212
161213``` purescript
162214fdNext :: forall eff. FileDescriptor -> Buffer -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
163215```
164216
217+ Convenience function to fill the whole buffer from the current
218+ file position.
219+
165220#### ` fdWrite `
166221
167222``` purescript
168223fdWrite :: forall eff. FileDescriptor -> Buffer -> BufferOffset -> BufferLength -> Maybe FilePosition -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
169224```
170225
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+
171229#### ` fdAppend `
172230
173231``` purescript
174232fdAppend :: forall eff. FileDescriptor -> Buffer -> Callback (buffer :: BUFFER | eff) ByteCount -> Eff (buffer :: BUFFER, fs :: FS | eff) Unit
175233```
176234
235+ Convenience function to append the whole buffer to the current
236+ file position.
237+
177238#### ` fdClose `
178239
179240``` purescript
180241fdClose :: forall eff. FileDescriptor -> Callback eff Unit -> Eff (fs :: FS | eff) Unit
181242```
182243
244+ Close a file asynchronously. See the [ Node Documentation] ( https://nodejs.org/api/fs.html#fs_fs_close_fd_callback )
245+ for details.
246+
183247
0 commit comments