home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iifixpth.inc < prev    next >
Text File  |  1997-10-07  |  1KB  |  59 lines

  1. <%
  2.  
  3. 'The physical directory may not currently
  4. 'exist in the metabase, so we have
  5. 'to find the closest parent associated with
  6. 'the dir and read the properties.
  7.  
  8.  
  9. Dim fpbaseobj, fpnewname, fpnewobj
  10.  
  11.  
  12. if (Session("vtype") = "dir") then
  13.  
  14.     fpbaseobj = path
  15.  
  16.     if err = 0 then 
  17.         'set the KeyType if it isn't already set...
  18.         if currentobj.KeyType = "" then
  19.             currentobj.KeyType = dirkeyType
  20.             currentobj.SetInfo        
  21.             Set currentobj=GetObject(currentobj.ADsPath)
  22.         end if
  23.     else
  24.         Do While err <> 0    
  25.         
  26.             response.write currentobj.ADsPath
  27.             'we need clear our path not found error..    
  28.             err = 0
  29.             
  30.             'and cyle through the fpbaseobj till we find the next whack,
  31.             'building up the path in new name as we go        
  32.             Do Until Right(fpbaseobj,1) = "/"
  33.                 fpnewname = Right(fpbaseobj,1) & fpnewname         
  34.                 fpbaseobj = Mid(fpbaseobj,1,Len(fpbaseobj)-1)
  35.             Loop
  36.         
  37.             'add the whack to the beginning of the path...
  38.             fpnewname = "/" & fpnewname     
  39.             response.write "<!-- " & fpnewname & "-->"
  40.             
  41.             'lop off the last whack...        
  42.             fpbaseobj = Mid(fpbaseobj,1,Len(fpbaseobj)-1)            
  43.             
  44.             'and try to set the object again...        
  45.             Set currentobj=GetObject(fpbaseobj)
  46.             Response.write ""
  47.  
  48.         Loop
  49.  
  50.         'lop off the first whack...        
  51.         fpnewname = Mid(fpnewname,2)    
  52.             
  53.         Set fpnewobj=currentobj.Create(dirkeyType, fpnewname)
  54.         fpnewobj.SetInfo
  55.         Set currentobj=GetObject(fpnewobj.ADsPath)    
  56.     end if    
  57. end if
  58.  
  59. %>