2 Replies Latest reply on Dec 11, 2008 5:58 PM by Almudever

    File patf with FileIO

      I'm working with FileIO Xtra and the file I want open is in a diferent folder.
      It is supposed that the normal line of code is:

      openFile(myFile,the moviePath&"myText.txt",1)

      Well, I' searching something like:

      openFile(myFile,the moviePath&Folder1&Folder2&"Text.txt",1)

      Can you help me?

        • 1. Re: File patf with FileIO
          robdillon Most Valuable Participant
          In order to write out a path, you will need to know the file separator charactor to use. On a Mac its ":" and on Windows its "\". So you'll have to add that in to your path.

          If you are creating for only one platform then the solution is simple, if you are working on a cross platform movie then you need to get that charactor. Here's a simple way to do that:
          fileSep = _movie.path.char[_movie.path.char.count]
          Then you can use that like this:
          openFile(myFile,the moviePath&Folder1&fileSep&Folder2&fileSep&"Text.txt",1)
          if Folder1 and Folder2 are the actual names of the folders then it would look like this:
          openFile(myFile,the moviePath&"Folder1"&fileSep&"Folder2"&fileSep&"Text.txt",1)
          • 2. Re: File patf with FileIO
            Almudever Level 1
            thank you very much