Files
wireadmin/web/src/lib/utils/fs-extra.ts
Shahrad Elahi ae787625b9 update
2024-05-29 18:32:19 +03:30

16 lines
327 B
TypeScript

import { accessSync, promises } from 'node:fs';
export function fsAccess(path: string): boolean {
try {
accessSync(path);
return true;
} catch (error) {
return false;
}
}
export async function fsTouch(filePath: string): Promise<void> {
const fd = await promises.open(filePath, 'a');
await fd.close();
}