Windows API behind "virtual files" in OneDrive

1.3k views Asked by At

OneDrive folder can show files as-if present, but they are not on disk.

https://support.microsoft.com/en-us/office/save-disk-space-with-onedrive-files-on-demand-for-windows-10-0e6860d3-d9f3-4971-b321-7092438fb38e

I'd like to create a similar folder programmatically. What API does OneDrive client use?

1

There are 1 answers

0
Simon Mourier On

From official documentation: Build a Cloud Sync Engine that Supports Placeholder Files

Windows 10 version 1709 introduced the cloud files API. This API is a new platform that formalizes support for sync engines. The cloud files API provides support for sync engines in a way that offers many new benefits to developers and end users.

The cloud files API contains the following native Win32 APIs and Windows Runtime (WinRT) APIs:

Cloud Filter API: This native Win32 API provides functionality at the boundary between the user mode and the file system. This API handles the creation and management of placeholder files and directories. Windows.Storage.Provider namespace: This WinRT API enables applications to configure the cloud storage provider and register the sync root with the operating system. Note

The cloud files API does not currently support implementing cloud sync engines in UWP apps. Cloud sync engines must be implemented in desktop apps.

Note that the Cloud Filter API provides you the API to manipulate Windows 10 1709's NTFS placeholders, but it will not help you build a "sync engine" at all... There's no notion of "synchronization" in this API.