Skip FileProvider folders without metadata

I want to traverse my local Google Drive folder to calculate the size of all the files on my drive.

I'm not interested in files or directories that are not present locally.

I use getattrlistbulk for traversing and it takes way too much time. I think it is because FileProvider tries to download metadata for the directories that are not yet materialised.

Is there a way to skip non-materialised directories?

Accepted Answer

Yeah, accessing a directory in a file provider triggers the enumeration in the file provider, which enumerates the items in the directory and may take a while.

You can probably opt out the dataless file materialization by following the Prepare your app for dataless file access in TN 3150. Did you try that?

- Ziqiao Chen @ Developer Technical Support @ Apple

Thank you! That's exactly what I need.

please help me,thanks!May I ask how to detect it on the macOS platform? I have tried but cannot determine if it is a dataless file because I want to use a fileprovider on the macOS platform to implement a function: only grant allowsTracing permission to downloaded files. If it is a dataless file, do not grant allowsTracing permission, but the system will automatically drain and clear the content. How to detect this (and how to determine if a file is a dataless file)

Skip FileProvider folders without metadata
 
 
Q