How do virtual files work in the client

Can someone explain how this works to me? Are the files shown on the computer running the desktop client, and in Windows Explorer “virtual files”? Like sort of “pointers” to the real files that don’t actually occupy any space on the computer? Or are all files on the NC server AND on the computer running the desktop client mirrored and eating up the exact same amount of space on both machines?

1 Like

For Linux Desktop Client, the latter is true.
For Windows and Mac, I do not know.

That is, indeed, the virtual files feature, using an API also used for OneDrive. Dropbox and others use the same, so it works the same. The files use a little bit of space, also because their thumbnails are synced as well, but the files themselves are indeed not synced until you click them. Then they are downloaded & opened and will be kept in sync.

As this uses a platform specific UI, it’s only available on Windows. There is a more basic version of the feature, kind of a trick, available on Mac OS and Linux, where it puts 0 byte files with the .nextcloud extension in the folder. When you click them they get opened by the client, which then syncs the file and opens it. It just isn’t as nicely integrated. For example it won’t work in a file open dialog of an app, won’t show thumbnails etc.

Some day we can hopefully bring this to Mac OS and Linux. but for Linux in particular the challenge is that there is just no API available so we would have to work with the desktop teams to design and implement one, then wait until it’s available. Ton of work for a small user base :confused:


May I ask (and this probably has been answered anywhere else, but I couldn’t find it), why for Linux not a File System in Userspace (FUSE) hasn’t been used? It should be capable of a more native integration than the current solution…

Are there any technical reasons?

1 Like
1 Like

ty. How does it handle if say, I drop a 1 gb file locally to the virtual folders? Does it copy the file to the server and keep the whole 1 gig file locally as well, or does it turn the local file into a virtual file so it occupies “no” space?

And also, lets say I click a virtual file and it syncs locally from the server; when I’m done doing whatever with it, does it “go back” to being virtual (and occupy no space locally) after it has synced back to the server?

My main curiosity/concern is keeping things locally small and using my server to eat up all the actual file space.

thats the same question i have. The file stays locally, i just can’t find anything on for how long this lasts.

On Windows with OneDrive there are options for storage optimization which automatically cleans up unused local files.
But I don’t know where this is handled. Could be that this is a feature of the API which the Nextcloud client also use or i could be implemented in OneDrive.

Afaik the files are staying on your desktop/device until you remove it manually.
A feature request already exists to implement the missing functionality:

1 Like

untill such feature exists in Nextcloud’s own client, the link provided by @j-ed has a comment from someone who mentions the use of Storage Sense, which is a windows function. And indeed i have Nextcloud in it, where i can set how long files should stay local before they become “online only” again. See these:

Still, i would feel better if this where a Nextcloud function. :slight_smile:

In Linux, how does the client know to open the .nextcloud files? If I try and open them, they get opened in the text editor. If I do “./nextcloud.appimage ~/path/to/file.nextcloud” I get “nextcloud.gui.application: Already running, exiting…” but then in the background, it does download the file and replace the .nextcloud one.

So how does the virtual file actually work in linux?

1 Like

i have a question by chiming in. Can you see the size of virtual file if you selected as sync instead of file it represents?

Yes, the file size is shown alsthough a file haven’t yet been synchronized to a client.