Re:Syncing files between browser and disk using Yjs and the ...
by slaymaker1907 on Monday May 09, 2022 @02:56PM
(#31318258)
Not the poster, but I wrote a Tiddlywiki plugin that uses these APIs (https://slaymaker1907.github.io/tiddlywiki/plugin-library.ht...) and I detect multiple write scenarios by keeping track of the file hash (this obviously only works for files which can be read into memory). Assuming you have a folder and not just a single file handle, you could scan the folder periodically and compare the known hashes to the ones on disk to handle moving files. Things would get much more complicated if you want to support both moving and modifying files and you'd need a system like Git for detecting renames.
[ Parent
| on HN ]
Re:Syncing files between browser and disk using Yjs and the ...
by karencarits on Monday May 09, 2022 @03:19PM
(#31318517)
Very nice, thank you for making this! It is so satisfying to see new technologies (eg filesystem API) actually solve old problems (eg tiddlywiki saving)