Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • invalid file specification

    Hey guys,

    Does anyone have this situation before? e.g.

    graph use "C:\Users\Guest\AppData\Local\Microsoft\Windows\Te mporary Internet F
    > iles\Content.IE5\Q0NQZXYM\CrimWinner.gph"
    invalid file specification

    This happens when I'm using Stata12 on Win7 and Mac OS.

    Although I can always store the graphs in other formats, I'm so curious what's wrong... Anyone can give me a clue?

    Thanks!



  • #2
    This error can occur for a multitude of reasons, not the least of which is that the file doesn't exist. Since there is nothing else obviously wrong with this statement, that seems like the most likely possibility, but it is hard to say since we can't see you hard drive. In any case, you might want to try a more standardized location than the Windows temporary internet files directory. While your code should work, it is somewhat unusual and has the potential for problems (errors in specifying the filename, accidentally deleting it when temp files are cleaned up, etc.).

    I am assuming, BTW, that your original code was:

    Code:
    graph use "C:\Users\Guest\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\Q0NQZXYM\CrimWinner.gph"
    and that the problem is not the extra space in "Te mporary" or the ">" in "F> iles"

    Comment


    • #3
      Hello Joe,

      Thanks a lot for your help! But I saved it to another address and it still doesn't work : ( Here it is:

      . graph use C:\Users\Guest\Desktop\Shapefiles\CrimWinner.gph
      invalid file specification
      r(198);

      Originally posted by Joe Canner View Post
      This error can occur for a multitude of reasons, not the least of which is that the file doesn't exist. Since there is nothing else obviously wrong with this statement, that seems like the most likely possibility, but it is hard to say since we can't see you hard drive. In any case, you might want to try a more standardized location than the Windows temporary internet files directory. While your code should work, it is somewhat unusual and has the potential for problems (errors in specifying the filename, accidentally deleting it when temp files are cleaned up, etc.).

      I am assuming, BTW, that your original code was:

      Code:
      graph use "C:\Users\Guest\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\Q0NQZXYM\CrimWinner.gph"
      and that the problem is not the extra space in "Te mporary" or the ">" in "F> iles"

      Comment


      • #4
        Code:
        set trace on
        and retry.
        Sergiy

        Comment


        • #5
          Hey Sergiy,

          Thanks for the reply. I set trace on and stata showed a long code. So I pasted the section went wrong below this paragraph. As a comparison, I also paste the code when I open a similar graph successfully.

          1.wrong code
          ---------------------------------------------------- begin gs_fileinfo ---
          - version 8
          - local 0 `"using `0'"'
          = local 0 `"using `""' , suffix"'
          - syntax using/ [, SUFFIX]
          invalid file specification
          ------------------------------------------------------ end gs_fileinfo ---
          exit 198
          }
          ------------------------------------------------------------- end gr_use ---
          exit
          }
          2.right code
          - version 8
          - local 0 `"using `0'"'
          = local 0 `"using C:\Users\Guest\Desktop\Graph.gph , suffix"'
          - syntax using/ [, SUFFIX]
          - gs_filetype `"`using'"', `suffix'
          = gs_filetype `"C:\Users\Guest\Desktop\Graph.gph"', suffix

          FYI, there seems to be a lot of sections named "begin gs_fileinfo" in the wrong code, while there is only one in the right code. Anyway I'm still confused...

          Thanks!
          Helene

          Originally posted by Sergiy Radyakin View Post
          Code:
          set trace on
          and retry.
          Sergiy

          Comment


          • #6
            I have a similar problem. I just created some .gph graphs and .png/.pdf versions of the same graphs from code statements (e.g., graph save for the .gph and graph export for the .pdf and .png). The pdf and png files are fine, but I get the same "invalid file specification" error when I try to open the .gph files (either from double clicking on the file in Windows Explorer, from file menu in Stata, or from using "graph use..." in interactive Stata. I'm working in Stata 12 on Win XP. Anyone else have similar problems?
            ****************************
            Survey Methodologist
            California Health Interview Survey

            Comment


            • #7
              "Matt" and "helenelu": welcome to the Forum. Please re-read the Forum FAQ and note the strong preference for full real names here (it's easy to fix: hit the Contact button bottom right and make your request). Please also note the remarks about using "CODE" delimiters to post information (cf. post #5).

              "helenulu": are you 100% sure that "CrimWinner.gph" is a Stata graph. Where does it come from and what Stata version was it created with (if it was Stata)? What were the commands you typed to get the two sets of output in post #5? [Show us exactly what you typed, using CODE delimiters.] Do the 2 files come from the same source?

              "Matt": it's hard to comment on your problems because you don't show us exactly what you typed and exactly what you got back from Stata: show us using "CODE" delimiters. Also, can you reproduce your problems using a dataset available to all of us, e.g. the "auto" dataset (sysuse auto)?

              Comment


              • #8
                Stephen is spot on, as usual. To summarize: we need to see exactly how these graphs were created. Note also that you can try looking inside such graph files, or even typing them, for any hints that they are not what you think. Having a .gph extension may mean no more than that.

                Comment

                Working...
                X