Use ConvertPath to convert between virtual and local paths. iSite is the id of the web site on a web server. If there is only one web site on the server, use 1. The "INSTANCE_ID" server variable can be used if the web server has more than one web site. (The web site id is needed because each site has its own mapping between virtual and local paths.) For the flags value, the following options are supported:
- dtsCpMakeVirtual (1) Convert a local path to a virtual path
- dtsCpMakeLocal (2) Convert a virtual path to a local path
- dtsCpRefreshMappings (16) Use the Metabase to update the table of local-to-virtual mappings that the dtSearch engine uses to perform these conversions.
- dtsCpStoreInRegistry (32)Store the updated table of mappings in the registry.
Internet Information Server stores its mapping between virtual and local paths in the Metabase. Reading this information from the Metabase is time-consuming and requires access rights that may not be available to a process running in the web server context. Therefore, the dtSearch Engine caches this information in the registry, under the key HKEY_LOCAL_MACHINE\Software\dtSearch Corp.\dtSearch\Virtual Roots. By default, ConvertPath will use the cached table values. Call ConvertPath with the dtsCpRefreshMappings + dtsCpStoreInRegistry flags to update the cached information. (Running dtWebSetup.exe, the dtSearch Web Setup program, will also update this information.)
If ConvertPath returns a blank string, it means that either (1) the folder passed in does not have a virtual directory associated with it, or (2) the registry tables have not been refreshed since the virtual directory was created.