I have my virtual disk program, which uses the Callback File System, running pretty well and we are about to deploy it.

I was wondering if you have seen a phenomenon that I have just recently experienced.

When I drag and drop a folder into my virtual disk, I sometimes see for some of the files in the folder, an extra file created with the name of the new file being the name of the old file with :Zone.Identifier appended to it.

I Googled this and saw that this is a file that Windows Internet Explorer creates when you download files from an untrusted Internet Zone. Is it possible that CBFS is causing Windows to think that I am downloading things from the Internet, instead of just copying them from another drive?

Those files are very annoying because they have an illegal character in their name and therefore are very hard to delete.

First of all, the created file is not a file, but a secondary named stream of a certain file. As such, you need to handle it as a stream. Next, you can (if allowed by your task) silently ignore the file by removing it right when it's closed. Deletion of such secondary stream from any file doesn't do any harm.

Thank you for clarifying this. I don't believe I care about these secondary streams, so I'm leaning towards using Vladimir's idea of just turning off the OnEnumerateNamedStreams callback. Is there any potential downside to doing that, and does it solve my problem by getting rid of the extra "file"? (yes I know it is not really a file), or will I still have to do as Eugene suggests and delete the stream upon close?

You can try both variants. But usually it's absolutely normal not to support alternate data streams. For example FATFS (that is usually used to format flash disks) doesn't support this feature. Also your CallbackFS implementation will be simplier without this.

OK, I am running Windows XP Professional, Service Pack 2, 32 bit and I am using the C++ Library Interface to CBFS.

By the way, I tried my own solution to the problem that was similar to Eugene's idea, which was that in my OnCreate callback, if I see that the file name has a colon in it, I do not create it on my Virtual Disk and I set the FileContext to NULL so that subsequent reads or writes for the same file do nothing. So, instead of deleting it on close as Eugene suggested, I just never create it. This actually worked well with one or two trials, so I am pretty satisfied with it at this point. That doesn't mean I wouldn't be interested in finding out if you do have a bug that needs to be addressed, as I'd rather a more robust solution than the one I just described.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.