0 Replies Latest reply on Jan 12, 2010 12:07 PM by jcox@Dublin School

    developing multi-platform AIR app and using flash.filesystem...

    jcox@Dublin School

      I am developing an AIR app using flex which needs to access both the local filesystem and syncs with network shares on my server.  In Windows, network shares are mounted as root directories, and my app easily locates the proper network share and links to it with no problems.  In Mac OSX  the network shares are mounted to /Volumes/<share name>.  However, flash.filesystem.File cannot seem to connect to the /Volumes directory.

       

      Currently the offending code looks like this:

                      var rootDirs:Array = File.getRootDirectories();
                      if(flash.system.Capabilities.os.substr(0,3) == "Mac")
                      {
                          syncTrace.text += "Reading Mac OSX File System.";
                          var volumes:File = (rootDirs[0] as File).resolvePath("Volumes/");
                          for each(var mnt:File in volumes)
                          {
                              syncTrace.text += "Checking " + mnt.nativePath + " for network store\n";
                              var mdb:File = mnt.resolvePath("db/");
                              if(mdb.exists)
                              {
                                  mdb = mdb.resolvePath("teachers.xml");
                                  if(mdb.exists)
                                  {
                                      serverStore = mnt;
                                      syncTrace.text += "Located network store at:  " + mnt.nativePath + "\n";
                                  }
                              }
                          }
                      }
                      else
                      {
                          for each(var drive:File in rootDirs)
                          {
                              syncTrace.text += "Checking " + drive.nativePath + " for network store\n";
                              var db:File = drive.resolvePath("db/");
                              if(db.exists)
                              {
                                  db = db.resolvePath("teachers.xml");
                                  if(db.exists)
                                  {
                                      serverStore = drive;
                                      syncTrace.text += "Located network store at:  " + drive.nativePath + "\n";
                                  }
                              }
                          }
                      }

       

      Is there another way I should reference files in Mac OSX, instead of as a url?