I am not sure this does the right thing.
It seems to rely on files not being in syncthings database which might not always be true, as I suspect previously synced now ignored files will be in the database with the invalid bit set.
as I suspect previously synced now ignored files will be in the database with the invalid bit set.
That doesn’t appear to be the case for the tests I did. I’d got several thousand files that were originally synced, then I added them to an ignore. That was several weeks (and version) ago. Then I looked at the database via the api and they don’t show up.
But maybe they get purged after a while? Regardless, the API documentation is pretty light on detail https://docs.syncthing.net/rest/db-browse-get.html doesn’t mention anything about ignored files or anything else.
If I were to do this, I’d have made it a pure filesystem walk and used the syncthing/lib/ignore package to parse the ignore file and print matches.
Feel free I’m sure several people would have found it useful.
More seriously though, this is my 2nd piece of go code, and the lib/ignore.go package isn’t documented - so it’s totally unclear (to me) on how to do anything with it.
Yeah that’s fair. Our internal-ish packages unfortunately aren’t really meant for public use. Here’s a quick example, without -print0 etc functionality (just give it the folder root).
Dear Jakob,
Is it possible to realize your example as a part of Syncthing REST API? I really need this feature as I’d like to know if my new local file is really new or it ignored. Actually I’d like to see something like GET /rest/db/file for a new local file that does not exist in database.