Skip to content

Commit

Permalink
Merge pull request #26 from dodomorandi/add-sync-lstat
Browse files Browse the repository at this point in the history
Add lstatSync and lstatSyncWith
  • Loading branch information
TheSpyder authored Mar 6, 2024
2 parents 0e1f74e + 58ea841 commit 3253390
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Fs.res
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ type openFileOptions = {
mode?: int,
}

type lstatSyncOptions = {
bigint?: bool,
throwIfNoEntry?: bool,
}

/**
* `readdirSync(path)`
* Reads the contents of a directory, returning an array of strings representing
Expand Down Expand Up @@ -257,6 +262,16 @@ external writeFileSync: (string, Buffer.t) => unit = "writeFileSync"
@val @module("node:fs")
external writeFileSyncWith: (string, Buffer.t, writeFileOptions) => unit = "writeFileSync"

@val @module("node:fs")
external lstatSync: @unwrap [#String(string) | #Buffer(Buffer.t) | #Url(Url.t)] => Stats.t =
"lstatSync"

@val @module("node:fs")
external lstatSyncWith: (
@unwrap [#String(string) | #Buffer(Buffer.t) | #Url(Url.t)],
lstatSyncOptions,
) => Stats.t = "lstatSync"

module FileHandle = {
type t = {fd: fd}

Expand Down

0 comments on commit 3253390

Please sign in to comment.