I am using electronjs and react app to sync some files between my server and filesystem. to sync files with filesystem I need to find new files from server and download them to filesystem, so I am using
const writer = fs.createWriteStream
and inside axios successfull response using to store file like below
response.data.pipe(writer);
every things fine but I need to sync any changes with filesystem to my server. for example if some old files just moved between some folders , I just need to find that file in my server and change it subfolder and no need to upload it again so I need some uniqe keys to recognize files. each files in my server have uniqe key to recognize. is it possible to attach some metadata to file whene I am saving it to filesystem like an id?
I know one way is to save files hash and compare files hash but for a large file it could take time.