0

I'm writing a file system using Dokan. What I want to achieve is allowing users to access files that are on multiple sources as if they are all on a local folder. i.e. a file can be available locally, on a remote location or in memory.

Initially I was creating placeholders that describe where the actually file is available (like the win8.1 OneDrive). When the user access a file, I read the placeholders first. Knowing the real location of that file, I read the real one and send the data back to the user application.

After about an hour of coding I found this idea seriously wrong. If the real location of the files are on the Internet, this will work. But if the file is available locally, I actually need request my hard drive to find two files(placeholder and the real file). Also, if the file is available in memory (users do this to improve performance), I still need to access the hard drive, making it pointless to cache the file into RAM.

So... I guess I have to write my own file table, like the NTFS MFT. Well, the concept of a file table is straightforward. But I'm not sure if I can write one that's as efficient as NTFS. Then I started considering a Database. But I'm also not sure if this is a good idea...

What should I do?

Thanks!

PS. I only have very basic knowledge of File Systems.

fjch1997
  • 1,518
  • 18
  • 19
  • IMHO, why do you need new file system in a first place? What is the usage scenario? E.g. [FAR manager](https://en.wikipedia.org/wiki/Far_Manager) has temporary panel (sandbox) virtual file systems, but I am absolutely never using it. I prefer to know location and just switch to it whenever its FTP, local/network disk or some other share. Database (as cached source) is surely better idea if you want to combine multiple sources of data in one view. But synchronization is not at all a trivial task. – Sinatr Aug 04 '15 at 08:59
  • @Sinatr I want the users to access the files in File Explorer as well as other programs. – fjch1997 Aug 04 '15 at 09:17
  • If I use sqlmetal to generate Linq to SQL code, will it be efficient enough? – fjch1997 Aug 04 '15 at 09:21

0 Answers0