Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-19623

File path length limit in AIR when creating directories

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.3 (Release)
    • None
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Browser: Firefox 3.x
      Language Found: English

    Description

      Steps to reproduce:

      Create an AIR application with just this code:

      var name:String = "abcdefghijkl1/abcdefghijkl2/abcdefghijkl3/abcdefghijkl4/abcdefghijkl5/abcdefghijkl6/abcdefghijkl7/abcdefghijkl8/abcdefghijkl9/abcdefghijkl0";
      var file:File = File.applicationStorageDirectory.resolvePath(name);
      file.createDirectory();

      Actual Results:

      When run from Flex Builder in debug mode, the correct file path is created (all the way to abcdefghijkl0).

      When you build the AIR application and install it and run it, then it only creates directories up to abcdefghijkl7. It also gives an error #3003 in flashlog.txt.

      It appears to be that there is a length limit on the path that can be passed to createDirectory.

      The same error appears if you try to open a FileStream to write to that path. It's not just a problem with createDirectory, but anytime the AIR runtime is asked to create a file with a long path.

      Expected Results:

      Debug version should behave the same as AIR runtime. If there is a length limit, it should be documented.

      Workaround (if any):

      THERE IS NONE! I thought I had a workaround but I don't. See below:

      var name:String = "abcdefghijklm";
      var file:File = File.applicationStorageDirectory.resolvePath(name);
      for (var i=0; i<10; i++)

      { trace('Creating ' + file.url); file.createDirectory(); file = file.resolvePath(name); }

      ... in this case only 7 levels of directories are being created (in AIR runtime on my system). In other words, there appears to be some kind of file path length limit which is strictly enforced in the AIR runtime (and which sucks).

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: