B4J Question How to search the hard drive(s) for a given folder?

Discussion in 'B4J Questions' started by Cableguy, Jun 22, 2016.

  1. Cableguy

    Cableguy Expert Licensed User

    Well, the title says it all...

    Given a name, how can we search ALL of the folders for a folder with the given name?
    Also, how to list the system accessible hard drives?
  2. Erel

    Erel Administrator Staff Member Licensed User

    There is no simple way to do it. You will need to actually go over all the folders by recursively calling File.ListFiles.

    For Each drive As String In ListRoots

    Sub ListRoots As List
    Dim jo As JavaObject
    Dim o() As Object = jo.InitializeStatic("java.io.File").RunMethod("listRoots"Null)
    Return o
    End Sub
    red30, arastoo and Cableguy like this.
  3. ThRuST

    ThRuST Well-Known Member Licensed User

    How to open any of the drives to browse contents on a Mac? Is Finder equal to Explorer on a PC?
  4. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice