Skip to content

Commit 3253390

Browse files
authored
Merge pull request #26 from dodomorandi/add-sync-lstat
Add lstatSync and lstatSyncWith
2 parents 0e1f74e + 58ea841 commit 3253390

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Fs.res

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ type openFileOptions = {
208208
mode?: int,
209209
}
210210

211+
type lstatSyncOptions = {
212+
bigint?: bool,
213+
throwIfNoEntry?: bool,
214+
}
215+
211216
/**
212217
* `readdirSync(path)`
213218
* Reads the contents of a directory, returning an array of strings representing
@@ -257,6 +262,16 @@ external writeFileSync: (string, Buffer.t) => unit = "writeFileSync"
257262
@val @module("node:fs")
258263
external writeFileSyncWith: (string, Buffer.t, writeFileOptions) => unit = "writeFileSync"
259264

265+
@val @module("node:fs")
266+
external lstatSync: @unwrap [#String(string) | #Buffer(Buffer.t) | #Url(Url.t)] => Stats.t =
267+
"lstatSync"
268+
269+
@val @module("node:fs")
270+
external lstatSyncWith: (
271+
@unwrap [#String(string) | #Buffer(Buffer.t) | #Url(Url.t)],
272+
lstatSyncOptions,
273+
) => Stats.t = "lstatSync"
274+
260275
module FileHandle = {
261276
type t = {fd: fd}
262277

0 commit comments

Comments
 (0)