Path.touchSync() method
pathlib-ts > Path > touchSync
Path.touchSync() method
Section titled “Path.touchSync() method”Create the file or update its timestamps synchronously.
Signature:
touchSync(options?: { mode?: number; existOk?: boolean; }): void;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
options |
{ mode?: number; existOk?: boolean; } |
(Optional) File creation behaviour flags ( |
Returns:
void
Remarks
Section titled “Remarks”Mirrors Path.touch() but executes synchronously.
Example
Section titled “Example”Creating a sentinel file synchronously
import { Path } from "pathlib-ts";
const sentinel = new Path("./tmp/.ready");sentinel.touchSync({ existOk: true });