October 2009
M T W T F S S
    Nov »
 1234
567891011
12131415161718
19202122232425
262728293031  

Archives

Categories

  • [+]ASP.NET (7) 
  • [+]C# (87) 
  • [+]C++ (13) 
  • [+]Delphi (20) 
  • [+]JavaScript (24) 
  • [+]Regular Expressions (7) 
  • [+]SQL (13) 
  • [—]VB (100) 
  • [+]VB.NET (4) 

Online

Users: 6 Guests, 1 Bot
  • Loading...


    Loading...

    Login






    Register | Lost password?

    Register





    A password will be mailed to you.
    Log in | Lost password?

    Retrieve password





    A confirmation mail will be sent to your e-mail address.
    Log in | Register
  • Creates the specified directory path (including subdirs if necessary)

    '-----------------------------------------------------------
    ' FUNCTION: MakePathAux
    '
    ' Creates the specified directory path.
    '
    ' No user interaction occurs if an error is encountered.
    ' If user interaction is desired, use the related
    '   MakePathAux() function.
    '
    ' IN: [strDirName] - name of the dir path to make
    '
    ' Returns: True if successful, False if error.
    '-----------------------------------------------------------
    '
    Function MakePathAux(ByVal strDirName As String) As Boolean
        Dim strPath As String
        Dim intOffset As Integer
        Dim intAnchor As Integer
        Dim strOldPath As String
    
        On Error Resume Next
    
        '
        'Add trailing backslash
        '
        If Right$(strDirName, 1) <> gstrSEP_DIR Then
            strDirName = strDirName & gstrSEP_DIR
        End If
    
        strOldPath = CurDir$
        MakePathAux = False
        intAnchor = 0
    
        '
        'Loop and make each subdir of the path separately.
        '
        intOffset = InStr(intAnchor + 1, strDirName, gstrSEP_DIR)
        intAnchor = intOffset 'Start with at least one backslash, i.e. "C:\FirstDir"
        Do
            intOffset = InStr(intAnchor + 1, strDirName, gstrSEP_DIR)
            intAnchor = intOffset
    
            If intAnchor > 0 Then
                strPath = Left$(strDirName, intOffset - 1)
                ' Determine if this directory already exists
                Err = 0
                ChDir strPath
                If Err Then
                    ' We must create this directory
                    Err = 0
    #If LOGGING Then
                    NewAction gstrKEY_CREATEDIR, """" & strPath & """"
    #End If
                    MkDir strPath
    #If LOGGING Then
                    If Err Then
                        LogError ResolveResString(resMAKEDIR) & " " & strPath
                        AbortAction
                        GoTo Done
                    Else
                        CommitAction
                    End If
    #End If
                End If
            End If
        Loop Until intAnchor = 0
    
        MakePathAux = True
    Done:
        ChDir strOldPath
    
        Err = 0
    End Function
    
    Share: These icons link to social bookmarking sites where readers can share and discover new web pages.
    • Digg
    • del.icio.us
    • Bloglines
    • Facebook
    • Google Bookmarks
    • LinkedIn
    • Technorati
    • TwitThis
    • Webnews

    Leave a Reply

     

     

     

    You can use these HTML tags

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <font color="" face="" size=""> <span style="">

    Spam Protection by WP-SpamFree Plugin