You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 8, 2022. It is now read-only.
Note: I don't necessarily need this in a cross-platform way, Linux-only would be fine. But cross-platform is always nice.
I'm making a recursive watcher for a medium-sized folder structure (~50000 files organized in a tree). I'd like to properly detect renames within the structure, so I can update some fields in a database instead of a delete/insert combo.
As of now, the only decent "solution" I've come up with is to walk the entire folder structure and save all os.FileInfo structs in a slice. Then, when a CREATE event comes (because the RENAME event doesn't mention the new name, it seems a bit useless). I check whether I already knew the file with os.SameFile, going over all saved os.FileInfo's. This sounds very heavyweight and I'd like to avoid it if at all possible.
Am I going about this the wrong way? Did I not look hard enough on Google and the mailing list (go-nuts)? (if that's the case, I apologize, I did try searching).