How to do an occ files:scan in an app?

Hello, i would to do an occ files:scan for a user in a personal app. How to perform this ?

What's the use case ? In general files:scan is only seen as a repair tool, not something to run in a regular fashion.

If your app is writing files into the data folder it should do so using the PHP APIs or through Webdav in which case the files will already be known to ownCloud