BrightScript plugin, directory or file ?

Hello, how to dertermine when i ListDir() if element is file or directory ?

Thanks :)

1 comment

  • 0
    Bright Scripters

    I'm not seeing an easy way to tell between a file and a directory.

    What is the final objective?

    If you iterate through the list returned by ListDir() you'll be able to see if an item contains sub items which would make it a directory. This method is not perfect as an empty directory would be identified as a file...


    for each item in DirList("/")
        if DirList(item).Count() > 0 then
            print item + " is a directory"
            print item + " is a file or empty directory"
        end if
    end for

Please sign in to leave a comment.