2 Replies Latest reply on Oct 13, 2008 6:43 PM by abeall

    IOError  — The directory did not exist and could not be created.

    abeall Level 3
      What causes this? I'm trying to create a directory in a directory on my desktop:

      // "dir" is the existing directory on the desktop
      public function exportFiles(dir:File){
      var file:File, fileTo:File, dirTo:File;
      // fileInfo is an array of XML nodes with metadata about files stored in applicationStorageDirectory
      for each(var f:XML in fileInfo){
      file = File.applicationStorageDirectory.resolvePath(f.filename);
      if(file.exists){
      fileTo = dir.resolvePath(f.groupName + "/" + file.name);
      dirTo = fileTo.parent;
      dirTo.createDirectory(); // IOError -- why?
      file.copyTo(fileTo,true);
      }
      }
      }