0

Similar to OneDrive's "Files On-Demand" as well as DropBox's "Smart Sync" functionality, I am curious how to create a file that appears to be on local disk normally but is actually linked / stored in the internet or cloud.

I think this is different from .lnk or .url files as they retain the following even if they are stored on the cloud:

  • filetype (.pdf, .xlsx, etc.)
  • location on disk (e.g. folder path)
  • size (original file size though size on disk is 0)
  • file icon

Is there another type of file or any metadata that tells Explorer that a particular file should be retrieved from the internet when it is accessed?

bloodfire1004
  • 493
  • 2
  • 8
  • 24
  • 1
    You sure the file size on disk is actually 0? I thought they always just created a synced copy on the computer and made sure it and the cloud version stayed up to date with each other. – gilliduck Jan 10 '18 at 14:15
  • 1
    The view in explorer is accomplished with a shell namespace extension, the "fake" file sizes can be accomplished on windows with [sparse files](https://stackoverflow.com/questions/43126760/what-is-a-sparse-file-and-why-do-we-need-it) & a minifilter driver can be used to intercept calls to files that need to be downloaded from the cloud. – Alex K. Jan 10 '18 at 14:22
  • Hi Alex K.! What you said seems to be interesting. Do you perhaps have more information or helpful articles you could share, particularly for the minifilter driver? – bloodfire1004 Jan 11 '18 at 15:02

1 Answers1

1

I don't know how the others do it but if I was creating something like this I'd have my client program create the dummy 0 size files with a unique extension that I have registered to my program then when the user double clicks on it, window will try to open the file with my program and I read the file name and do the work to download the file to some temp folder so the user can view it.

Further you could monitor the temp folder so that if the user saves any changes you could upload those changes to your cloud location.

Echostorm
  • 9,678
  • 8
  • 36
  • 50
  • Ah I see, yes that seems like one way to pull it off. I'd like to ask though is it possible for a file to have its file type extension as well as another extension unique to your program? – bloodfire1004 Jan 10 '18 at 14:27
  • Windows will only allow an extension to be associated with one program at a time. You could have a naming scheme with a pre extension like foo.pre.main but I don't know what you're trying to buy with this – Echostorm Jan 10 '18 at 14:41