2 Replies Latest reply on Feb 23, 2009 2:44 PM by Gregory Lafrance

    FileSystemTree on Mac

    Gregory Lafrance Level 6
      On Windows, FileSystemTree gets all drives for the machine, but on Mac it seems to only get the main volume for the machine, as in the volume where the OS is installed.

      How can I initialize a FileSystemTree so it displays all volumes on a Mac?
        • 1. Re: FileSystemTree on Mac
          Jed Schneider Level 1
          I'm not sure what logic Flex uses to determine what to show/not show, but if you turn on the showHidden property of your FileSystemTree, it will show all the hidden files, including the /Volumes directory. These will be all the mounted drives to the system. I just played with it for a few minutes and you're right, the mounted drives will not show up if you browse to the user/Desktop on the tree. Maybe there is a way to turn on symbolic links, which is what these mount points on the desktop most certainly are. Anyway, I just played with it for a few minutes, but this worked for me.

          <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:FileSystemTree id="testTree" showHidden="true"/>
          </mx:WindowedApplication>
          • 2. FileSystemTree on Mac
            Gregory Lafrance Level 6
            showHidden ended up showing too much, but thanks very much for your response. I went with this:

            var isWin:Boolean = (Capabilities.os.indexOf("Windows") >= 0);
            var isMac:Boolean = (Capabilities.os.indexOf("Mac OS") >= 0);
            var currOS:String = isWin ? "win" : "mac";

            var topDir:File = currOS=="mac" ? new File('/Volumes') : FileSystemTree.COMPUTER;
            myFileSysTree.directory = topDir;