Shell items have a bunch of attributes. For example, SFGAO_
FOLDER
means that the item is a folder, and it will show up in the navigation pane as a folder. Since it’s a folder, you can bind to it and enumerate children. But what if you need more information about what kind of folder it is?
The other attributes SFGAO_
FILESYSTEM
, SFGAO_
FILESYSANCESTOR
, and SFGAO_
STREAM
can help you distinguish the various scenarios.
The SFGAO_
FILESYSTEM
attribute means that the item exists in the file system, and the parsing name for a SFGAO_
FILESYSTEM
object can be used to access the corresponding entity in the file system.
The SFGAO_
FILESYSANCESTOR
attribute means that the item or one of its children might have the SFGAO_
FILESYSTEM
attribute. This attribute is used by the File Open and File Save dialogs, for example, to decide whether to filter out the item. If it’s possible to reach the file system via the item, then the File Open and File Save dialogs will include the item. You may not be able to save directly to the item (such as My Computer), but it will let you navigate through it on the way to something you can save to.
The SFGAO_
STREAM
attribute means that the item can produce bytes of data. If combined with the SFGAO_
FILESYSTEM
attribute, it means that the underlying storage for the item is a file. Even though the underlying storage is a file system file, it may be exposed in the shell namespace as a folder. For example, ZIP files are file system files, but they show up in the shell namespace as a folder, so that you can open them up and drag files into or out of them.
Let’s summarize this in a chart.
SFGAO_ FILESYSTEM ? |
SFGAO_ FOLDER ? |
SFGAO_ STREAM ? |
Result | Example |
---|---|---|---|---|
Virtual file with no data | Dial-up networking connectoid | |||
SFGAO_ STREAM |
Virtual file with data | File on an FTP site | ||
SFGAO_ FOLDER |
Virtual folder | Control Panel | ||
SFGAO_ FOLDER | |
SFGAO_ STREAM |
Virtual folder with data | ? | |
SFGAO_ FILESYSTEM |
File system file with no data | Symbolic link | ||
SFGAO_ FILESYSTEM | |
SFGAO_ STREAM |
File system file with data | Traditional file system file | |
SFGAO_ FILESYSTEM | |
SFGAO_ FOLDER |
File system directory | Traditional file system directory | |
SFGAO_ FILESYSTEM | |
SFGAO_ FOLDER | |
SFGAO_ STREAM |
Virtual directory inside a file system file | ZIP file |
I couldn’t think of an example of a virtual folder with data.
0 comments