Results 1 to 2 of 2

Thread: check empty directory

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    6
    how do i check if a directory is empty. For example, lets assume i have directory call "app" in the path "c:\app". i want to check this directory is empty. if is not empty i want to read what ever inside the dirctory "app". Maybe i have one file or bunch of file. Now with out knowing the file name how do i read what ever inside the directory "apps"

    thankx
    amal

  2. #2
    Guest
    Use the Dir function.

    Code:
    Private Sub Command1_Click()
        Dim FileFinder
        List1.Clear
        FileFinder = Dir("C:\Windows\")
        Do Until FileFinder = ""
        List1.AddItem LCase(FileFinder)
        FileFinder = Dir
        Loop
    End Sub
    What it will do is add all the files in a directory to a Listbox, if there are no files in a directory, than it won't list anything.

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