https://docs.microsoft.com/en-us/windows/win32/fileio/obtain... ; the Linux equivalent is "inotify".
> I press 'o' on a track and it opens a file explorer in the location where the track is located and it also selects it
https://stackoverflow.com/questions/13680415/how-to-open-exp...
On Linux, you'd have to do some kind of GNOME integration I am not familiar with. The Windows shell integration is a very handy API, although you have to do the usual digging for explanations and examples.
I too have a large library and foobar just picks it up immediately.