Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Virtual Folders and hooking them into the file system

I have a big collection of folders for projects I'm working on. I've been trying to find a better way to sort them all for a long time and I want to write an app that creates groups based on whatever criteria I say, such as "folders from 2011" or "folders containing a x type of file" etc.

This is fairly straightforward, and wouldn't present much of a problem to code using its own UI in winForms or WPF or something. But I think it would be far better if I could make these folders appear to be part of the filesystem, so other apps (like existing file explorers) can see them.

Is this possible? Would it cause problems I haven't considered? How do I go about doing it if it is possible?

One way I thought of doing it would be to have the app monitor the filesystem and create folder shortcuts every time there's a change, but I'm curious about whether its possible to actually present a fake filesystem to explorer through a 'gateway' folder

EDIT: Ok it's obviously possible since http://www.virtualfolder.net/ can do it, and now that I think of it so can TrueCrypt, although it would be nice if it didn't have to appear as a separate drive. So the question becomes, how do I implement it?

like image 530
roryok Avatar asked Dec 18 '12 12:12

roryok


People also ask

What is the virtual folder in computer?

In computing, a virtual folder generally denotes an organizing principle for files that is not dependent on location in a hierarchical directory tree.

How do I create a virtual folder in Windows 10?

Right-click the Web site that you want (for example, Default Web Site), point to New, and then click Virtual Directory. On the Welcome to the Virtual Directory Creation Wizard page, click Next. On the Virtual Directory Alias page, type the alias that you want (for example, Sales), and then click Next.

What are virtual folders used to store?

Virtual folders are folders with no assigned objects, but an assigned search function. When a virtual folder is opened, the stored search is performed and the results are displayed. The name virtual points out that this folder only displays search results. The actual position of the shown objects remains unchanged.


2 Answers

You can create a Shell Namespace Extension that gathers the file information you want and displays it within Windows Explorer any way you wish. You can choose where your extension is located, whether as its own top-level node, a child of another system virtual folder/extension, or as a child of a file system folder.

Writing a SNE is not trivial, but it is a lot easier then writing a lower-level file system driver, and it does not require special driver-oriented compilers. Any compiler that supports developing COM objects will work.

like image 93
Remy Lebeau Avatar answered Oct 27 '22 19:10

Remy Lebeau


This is accomplished using filesystem drivers or filesystem filter drivers. First let you create a virtual filesystem and mount it to a drive letter and also to a folder on NTFS drive (folder must exist but its contents are "replaced" with a virtual filesystem directory tree). Filesystem filter drivers let you introduce virtual files and folders in existing folders without replacing them.

VirtualFolder uses filesystem driver as it creates a drive letter.

Both types of drivers are written in C and work in kernel-mode. Writing them requires deep knowledge of Windows internals and experience with driver development (since filesystem drivers are one of the most complicated driver types).

We offer several products related to virtual storage. One of them, Callback File System, is a filesystem driver. It calls your user-mode code to perform actual filesystem functions. Another product, CallbackFilter, is an FS filter driver (and it also calls your user-mode code). However, current version of CallbackFilter doesn't let you introduce virtual files and folders (this would be implemented in the next release).

There's also Pismo File Mount product available, they use filter driver techniques. You can check with them if what you need can be accomplished.

like image 35
Eugene Mayevski 'Callback Avatar answered Oct 27 '22 20:10

Eugene Mayevski 'Callback