Folders that aren't folders. 
Author Message
 Folders that aren't folders.

I've been playing with a couple of apps recently which manipulate
folders and files. I check for file attribute = 16 to divide the folders
from the files. Some folders don't follow this rule, although they appear
in explorer as folders they are obviously some kind of file which acts
as a container for other files (just like a folder? I didn't describe that
very
well). Folders like the History and Subscriptions folders under Windows
folder.

These so called folders seem to give back various attribute values which
make it hard to pin them down.

Does anyone know a good way of dealing with these types of folders,
one that can routinely and correctly identify them and treat them like a
normal folder?

Anyone know any good info sources on these things?

Many thanks in advance.
--
----------------------------------------------------------------------------
-----------

(remove nospam to reply)

Homepage http://www.*-*-*.com/
(VB, REXX, X86ASM, Oracle, SQL)
----------------------------------------------------------------------------
-----------



Sat, 23 Sep 2000 03:00:00 GMT  
 Folders that aren't folders.

You can't test for "= 16", because a directory doesn't always have *only*
the directory attribute (i.e., other attributes, like Archive or Hidden, are
"Or"ed in). To test a value for a specific attribute, use this:

If (FAttr And 16) = 16 Then
    'It's a directory
End If

--
Ben Baird, MVP
Microsoft SiteBuilder Network Level 2
Visual Basic Thunder, v. 2.0
http://www.{*filter*}highway.com/~psy/
Common Controls Replacement Project, Official Member
http://www.*-*-*.com/
Please direct your programming questions to the newsgroups.

Quote:

>I've been playing with a couple of apps recently which manipulate
>folders and files. I check for file attribute = 16 to divide the folders
>from the files. Some folders don't follow this rule, although they appear
>in explorer as folders they are obviously some kind of file which acts
>as a container for other files (just like a folder? I didn't describe that
>very
>well). Folders like the History and Subscriptions folders under Windows
>folder.

>These so called folders seem to give back various attribute values which
>make it hard to pin them down.

>Does anyone know a good way of dealing with these types of folders,
>one that can routinely and correctly identify them and treat them like a
>normal folder?

>Anyone know any good info sources on these things?



Sat, 23 Sep 2000 03:00:00 GMT  
 Folders that aren't folders.

Yes sorry, I side tracked you a bit. What I meant was I have no
problem telling a standard folder from a normal file whatever
its attributes are. I am more interested in these virtual folders.
How can you reliably detect them? How should they be handled
within an application that processes file system objects?

--
----------------------------------------------------------------------------
-----------

(remove nospam to reply)

Homepage http://www.*-*-*.com/
(VB, REXX, X86ASM, Oracle, SQL)
----------------------------------------------------------------------------
-----------

Quote:

>You can't test for "= 16", because a directory doesn't always have *only*
>the directory attribute (i.e., other attributes, like Archive or Hidden,
are
>"Or"ed in). To test a value for a specific attribute, use this:

>If (FAttr And 16) = 16 Then
>    'It's a directory
>End If

>--
>Ben Baird, MVP
>Microsoft SiteBuilder Network Level 2
>Visual Basic Thunder, v. 2.0
>http://www.{*filter*}highway.com/~psy/
>Common Controls Replacement Project, Official Member
> http://www.*-*-*.com/
>Please direct your programming questions to the newsgroups.


>>I've been playing with a couple of apps recently which manipulate
>>folders and files. I check for file attribute = 16 to divide the folders
>>from the files. Some folders don't follow this rule, although they appear
>>in explorer as folders they are obviously some kind of file which acts
>>as a container for other files (just like a folder? I didn't describe that
>>very
>>well). Folders like the History and Subscriptions folders under Windows
>>folder.

>>These so called folders seem to give back various attribute values which
>>make it hard to pin them down.

>>Does anyone know a good way of dealing with these types of folders,
>>one that can routinely and correctly identify them and treat them like a
>>normal folder?

>>Anyone know any good info sources on these things?



Sun, 24 Sep 2000 03:00:00 GMT  
 Folders that aren't folders.

My answer is probably going to be more complicated than you want it to be,
but it's the only answer I know of: Go to my homepage and download
edeskvb.zip from the Source Code section. It's a large example, but it will
show you how to deal with the parts of the namespace, such as Desktop, etc.

--
Ben Baird, MVP
Microsoft SiteBuilder Network Level 2
Visual Basic Thunder, v. 2.0
http://www.{*filter*}highway.com/~psy/
Common Controls Replacement Project, Official Member
http://www.*-*-*.com/
Please direct your programming questions to the newsgroups.

Quote:

>Yes sorry, I side tracked you a bit. What I meant was I have no
>problem telling a standard folder from a normal file whatever
>its attributes are. I am more interested in these virtual folders.
>How can you reliably detect them? How should they be handled
>within an application that processes file system objects?



Sun, 24 Sep 2000 03:00:00 GMT  
 Folders that aren't folders.

They are handled just like any other folder.  That's why they are
called folders.  From a VB program, open one and see.  Just try it.
It won't hurt.  You will get the contents just like any other folder.

Well, almost like any other folder.  A VB3 program (and maybe a VB4-16
one) will not see, for instance, Windows\Fonts but a VB5 (and maybe a
VB4-32 one) will.  They have files just like any other folder.
Windows simulates them for you so they look the same.

How do you want to handle them?  What do you want to do to the
contents?  

Mike Morrow

On Wed, 8 Apr 1998 09:08:25 +0100, "Elliot Spencer"

Quote:

>Yes sorry, I side tracked you a bit. What I meant was I have no
>problem telling a standard folder from a normal file whatever
>its attributes are. I am more interested in these virtual folders.
>How can you reliably detect them? How should they be handled
>within an application that processes file system objects?



Sun, 24 Sep 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Enumerate a Folder and it's Sub Folders

2. Using folder object when the user doesn't have access to the folder

3. folder in a folder in a folder...

4. Build XML of folders, sub folders and files from specified folder

5. Determining if a folder is a local pst folder or a imap (server folder)

6. How to delete folders/files within a folder but not the folder itself

7. Add contact information to folder other than default folder

8. MAPI folder and System Folders

9. Syncing public folders with local folders automatically

10. Exchange folder clashes with personal folder

11. How can I get/guess email address of a folder under the Public Folder

12. Creating Folder and Tasks in Folder

 

 
Powered by phpBB® Forum Software