Adding additional files to a real directory

26 views
Skip to first unread message

Joe Best-Rotheray

unread,
May 20, 2021, 4:13:42 PM5/20/21
to Dokan
Hi all,

I'd like to mount some cloud storage as a folder, and then cache some of the files locally when accessed. This is relatively straightforward if I mount my virtual folder at C:\MyFiles and then cache files in C:\MyFiles_Cache or something. But is there a way that I can store the cached files in C:\MyFiles as well? I would need some way to pass through certain functions to the default file system driver, not sure if it's possible with Dokan - maybe I'd need to use a shell extension instead?

Any help much appreciated
Cheers
Joe

Adrien JUND

unread,
May 20, 2021, 5:15:21 PM5/20/21
to do...@googlegroups.com
Hi,

Adding functionality to an existing filesystem is not possible with dokan.
What you can do is to mount into a folder C:\MyCloudStorage on a existing filesystem and control the content in it with your dokan implementation of the API. Then you can provide a cached or no content when read is called.

Best regards,
Liryna

--
You received this message because you are subscribed to the Google Groups "Dokan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dokan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dokan/308b8f49-b94e-4417-850f-137f686cb2f9n%40googlegroups.com.

Joe Best-Rotheray

unread,
May 20, 2021, 5:27:17 PM5/20/21
to Dokan
But I would need to store those cached files outside of C:\MyCloudStorage, correct?

Cheers
Joe

Adrien JUND

unread,
May 21, 2021, 1:24:08 AM5/21/21
to do...@googlegroups.com
Since with dokan you control the listing, you can show whatever you want in it.
Look at the samples available. One is a mirror that redirect IO to another folder to replicate the content. The other one is a mirror filesystem that only contains non physical files.
A mix of both and you get what you want I believe.

Joe Best-Rotheray

unread,
May 21, 2021, 4:15:49 AM5/21/21
to Dokan
Yeah that's what I've tried to do, but I can't find a way to access the real files in the folder, as whatever System.IO functions I call to access the files gets redirected to my Dokan application  ¯\_(ツ)_/¯

Adrien JUND

unread,
May 21, 2021, 4:50:39 AM5/21/21
to do...@googlegroups.com
This is normal. It is your dokan application that needs to redirect them to your cache.

Joe Best-Rotheray

unread,
May 21, 2021, 4:58:32 AM5/21/21
to Dokan
But how can I redirect them to my cache if the cache folder is the same as my Dokan folder?

Adrien JUND

unread,
May 21, 2021, 5:20:02 AM5/21/21
to do...@googlegroups.com
Oh sorry, you are looking to not have C:\MyFiles_Cache
Unfortunately I do not see how it is possible with dokan.

A filter driver might be what you are looking for.

Joe Best-Rotheray

unread,
May 21, 2021, 5:52:09 AM5/21/21
to Dokan
ok great I'll read into filter drivers a bit, there's also the cloud files API which seems to have been made for this use case, I just thought I'd check here first as I've already done some prototyping in Dokan :)

Thanks for all your help!
Joe

Reply all
Reply to author
Forward
0 new messages