Results 1 to 7 of 7

Thread: recursive file delete

  1. #1

    Thread Starter
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179

    recursive file delete

    i need to do a recursive file delete of *.lnk can anyone help?
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    In a specific directory, or through all subdirectories too ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    recursive = subdirectories
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  4. #4
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Here you go.

    To get you started:
    http://pages.about.com/vbmakai/getfiles.htm

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by aturner
    recursive = subdirectories
    Recursive does not mean subdirectories.
    It means to call the operation from inside itself.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6

    Thread Starter
    Addicted Member aturner's Avatar
    Join Date
    Nov 2000
    Posts
    179
    so just to clear air, what is the definition of a recursive directory search

    but yes, i would like to know how to search subdirectories
    Due to the energy crisis, the light at the end of the tunnel has been turned off.
    Sorry for any inconvenience this may cause

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Recursive just means that the algorithm calls itself again on the results it produces.

    So a recursive directory search would find all files/dirs in a given dir, and then all files/dirs in those dirs etc.

    A recursive maths function for GCD could look like this :
    VB Code:
    1. Public Function GCD(num1 As Long, num2 As Long) As Long
    2.     If (num1 = 1) Or (num2 = 1) Then
    3.         GCD = 1
    4.     Else
    5.         If (num1 = num2) Then
    6.             GCD = num1
    7.         Else
    8.             If (num1 > num2) Then
    9.                 GCD = GCD(num1 - num2, num2)
    10.             Else
    11.                 GCD = GCD(num2 - num1, num1)
    12.             End If
    13.         End If
    14.     End If
    15. End Function

    A recursive file search doesnt mean very much....
    But a file search that searched recursively through directories does.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width