Results 1 to 2 of 2

Thread: [2005] Not getting all files in a directory properly...

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    Resolved [2005] Not getting all files in a directory properly...

    Code:
    Dim FileList As New List(Of String)
    ''The IO.SearchOptions.AllDirectories Flag tells it to search all subdirectories as well
    ''Set the search pattern to *.* telling it get all files
    FileList.AddRange(IO.Directory.GetFiles(Directories.KCPath, "*.*", IO.SearchOption.AllDirectories))
    ReDim LockFiles(FileList.Count - 1)
    For i As Integer = 0 To FileList.Count() - 1
        LockFiles(i) = New FileStream(FileList(i), FileMode.Open)
    Next i
    FileList.Clear()
    I have a directory like this:

    Code:
    CompanyName
        File "somefile1"
        File "somefile2"
        File "somefile3"
        Folder1
            File 1
        Folder 2
            File 1
        Folder 3
            File 1
    The only files that become 'locked' or 'protected' from deletion are 'somefile1, 2, and 3'

    The files in the folders can be deleted...

    Does anyone know why it is not detecting them?
    Thanks
    Last edited by Icyculyr; Dec 4th, 2007 at 07:51 PM.

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