basic filewatcher using websocket

This commit is contained in:
Nystik
2026-03-22 14:56:05 +01:00
parent be0792dab7
commit c5f5bec324
8 changed files with 342 additions and 11 deletions

View File

@@ -1,3 +1,5 @@
import { markLocalOp } from "./echo-guard.js";
export function createFsSync(metadataCache, contentCache, transport) {
return {
existsSync(path) {
@@ -64,6 +66,7 @@ export function createFsSync(metadataCache, contentCache, transport) {
encoding = encoding?.encoding;
}
markLocalOp(path);
contentCache.set(path, data);
const size =
@@ -87,6 +90,7 @@ export function createFsSync(metadataCache, contentCache, transport) {
},
unlinkSync(path) {
markLocalOp(path);
contentCache.delete(path);
metadataCache.delete(path);