July 14, 2001

Creating an XML Document: The Way of Speed

If you search the Web and the various articles in magazines and MSDN you can find a lot of documentation about the fastest way of reading an XML document. Speaking of Microsoft XML Parser release 3.0, one of the most commonly discussed issues is whether use the DOM parser or

SynchronizeDirectoryTrees – Synchronize files in two directory trees

‘ Synchronize two directory subtrees” This routine compares source and dest directory trees and copies files’ from source that are newer than (or are missing in) the destination directory’ if TWOWAYSYNC is True, files are synchronized in both ways’ NOTE: requires the CompareDirectories and SynchronizeDirectories routines’ and a reference to

SynchronizeDirectories – Synchronize the contents of two directories

‘ Synchronize two directories” This routine compares source and dest directories and copies files’ from source that are newer than (or are missing in) the destination directory’ if TWOWAYSYNC is True, files are synchronized in both ways’ NOTE: requires the CompareDirectories routine and a reference to’ the Microsoft Scripting Runtime

CompareDirectories – Find different files in two directories

Enum CompareDirectoryEnum cdeSourceDirOnly = -2 ‘ file is present only in the source directory cdeDestDirOnly = -1 ‘ file is present only in the dest directory cdeEqual = 0 ‘ file is present in both directories, ‘ with same date, size, and attributes cdeSourceIsNewer = 1 ‘ file in source

GetFileOwner – Get the owner of an NTFS file

Private Declare Function GetFileSecurity Lib “advapi32.dll” Alias _ “GetFileSecurityA” (ByVal lpFileName As String, ByVal RequestedInformation _ As Long, pSecurityDescriptor As Byte, ByVal nLength As Long, _ lpnLengthNeeded As Long) As LongPrivate Declare Function GetSecurityDescriptorOwner Lib “advapi32.dll” _ (pSecurityDescriptor As Any, pOwner As Long, lpbOwnerDefaulted As Long) As _ LongPrivate Declare

FolderHasSubfolders – Determine whether a directory has one or more subdirectories

Private Const MAX_PATH = 260Private Type SHFILEINFO hIcon As Long iIcon As Long dwAttributes As Long szDisplayName As String * MAX_PATH szTypeName As String * 80End TypePrivate Declare Function SHGetFileInfo Lib “Shell32” Alias “SHGetFileInfoA” _ (ByVal pszPath As Any, ByVal dwFileAttributes As Long, psfi As SHFILEINFO, _ ByVal cbFileInfo As