Results 1 to 4 of 4

Thread: Directory Listing

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

    Post

    the 2nd time you use dir(), you don't specify you want only files... (or, alternatively, you don't check if it's a directory before you print it...)

  2. #2
    Guest

    Post

    Silly me!! You'd think I'd have spotted that, wouldn't you!!! Cheers.

    ------------------
    Matthew Ralston
    E-Mail: m.ralston@mediavault.co.uk
    ICQ:31422892
    Web Sites:The Blue Link My Home Page

  3. #3
    Guest

    Post

    Ok, I've added this bit to the second Dir$ statemets (for the files)...

    vbNormal + vbHidden + vbReadOnly + vbSystem + vbArchive

    ...but it still reports many of the ordinary files as being folders. What's going on?!

    ------------------
    Matthew Ralston
    E-Mail: m.ralston@mediavault.co.uk
    ICQ:31422892
    Web Sites:The Blue Link My Home Page

  4. #4
    Guest

    Post

    I've got a direcotry listing function that I'm using as part of a Telnet Server I'm making, but when I execute it many items get duplicated and some get reported as both files and folders... Any Ideas why?

    Code:
    Private Sub Dir_List()
    	Dim sLine As String, iFiles As Integer, iFolders As Integer
    
    	debug.print vbCrLf
    
    	' Folders
    	sLine = Dir$("*.*", vbDirectory)
    	Do Until sLine = ""
    		debug.print sLine & vbTab & vbTab & vbTab & "<dir>" & vbCrLf
    		sLine = Dir
    		iFolders = iFolders + 1
    	Loop
    
    	' Files
    	sLine = Dir$("*.*")
    	Do Until sLine = ""
    		debug.print sLine & vbCrLf
    		sLine = Dir
    		iFiles = iFiles + 1
    	Loop
    
    	debug.print "-----------------" & vbCrLf
    	debug.print iFiles & " file(s), " & iFiles & " folder(s)." & vbCrLf & vbCrLf
    End Sub
    ------------------
    Matthew Ralston
    E-Mail: m.ralston@mediavault.co.uk
    ICQ:31422892
    Web Sites:The Blue Link My Home Page

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