Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

API to return a folder's type: <SYMLINKD> or <JUNCTION>

1 view
Skip to first unread message

PeterD

unread,
May 16, 2008, 7:27:48 PM5/16/08
to
Anyone know of an api that will return whether a folder is a true
folder or is actually a symbolic link/junction?

Perhaps an API that returns folder properties?

PeterD

unread,
May 16, 2008, 9:00:52 PM5/16/08
to

To answer my own question, this works just fine:

======

Sub Command_Click()

Const FILE_ATTRIBUTE_READONLY = &H1&
Const FILE_ATTRIBUTE_HIDDEN = &H2&
Const FILE_ATTRIBUTE_SYSTEM = &H4&
Const FILE_ATTRIBUTE_DIRECTORY = &H10&
Const FILE_ATTRIBUTE_ARCHIVE = &H20&
Const FILE_ATTRIBUTE_ENCRYPTED = &H40&
Const FILE_ATTRIBUTE_NORMAL = &H80&
Const FILE_ATTRIBUTE_TEMPORARY = &H100&
Const FILE_ATTRIBUTE_SPARSE_FILE = &H200&
Const FILE_ATTRIBUTE_REPARSE_POINT = &H400&
Const FILE_ATTRIBUTE_COMPRESSED = &H800&
Const FILE_ATTRIBUTE_OFFLINE = &H1000&
Const FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = &H2000&

Dim x As Long

x = GetAttr(Text.Text)

If (x And FILE_ATTRIBUTE_REPARSE_POINT) = _
FILE_ATTRIBUTE_REPARSE_POINT Then

Debug.Print "FILE_ATTRIBUTE_REPARSE_POINT"
End If
End Sub

======

Note: FILE_ATTRIBUTE_REPARSE_POINT is either a <SYMLINKD> or
<JUNCTION> object. (Probably also a <SYMLINK> too.)

0 new messages