Announcement

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

  • MAC OSX - command cd

    I have typed the command cd followed by the file path which I have copied from the "get info" tab. However, I keep getting r170:
    unable to chdir;
    (Unix and Mac.) cd was unable to change to the directory you
    typed because either it does not exist, it is protected, or it
    is not a directory.

    I've recently upgraded to MAC OSX - could that be the reason? Has anyone had the same problem?

    Thanks a lot!

    Best

    Chiara

  • #2
    As the Forum FAQ says, you need to show us exactly what you typed into Stata and exactly what you got back. Do not use a photo or screenshot when posting this information; please use "CODE" delimiters. (How to do so is explained in the FAQ too. You'll see that it's easy.)

    Comment


    • #3
      Agree with Stephen, show us what you have typed. I and many others for sure use the command everyday !!
      Roman

      Comment


      • #4
        Don't forget that from Stata's File menu you can chose Change Working Directory to use the GUI to navigate to your directory of choice. If you try that and get the same error message, then the error message is right. If it works, then you can compare the cd command Stata shows in the Results window with the cd command that failed.

        Comment


        • #5
          I've recently upgraded to MAC OSX - could that be the reason?
          Probably not, but this is a bit puzzling, since Mac OSX was introduced more than ten years ago. What were you using before? Or do you mean that you upgraded to a more recent version of OSX? That probably wouldn't matter, but as mentioned previously you need to provide more details.

          Comment


          • #6
            I have no problem using the cd command under Mac, and my mac is also updated to the newest version..
            I just use the normal command without problem cd /Users/.../xxxx.

            You mentioned you use the "get info" tab, I notice under the new Yosemite, when you copy paste the path, you get a arrow instead of the normal "/", so if this is the case, you have you change the arrow into / manually.
            Last edited by Li Chen; 27 Jan 2015, 13:46.

            Comment


            • #7
              You may also need to put quotes around the path if it contains spaces or other characters that could confuse "cd"

              Comment


              • #8
                Hello everyone,

                I have the same problem as Chiara. I use Stata 17 SE on the Mac. First I enter the following code:

                global root "/Users/xxx/00_create/"

                Then a few codes follow and everything works fine. Then I enter the following code:

                cd "${in_path}"

                And I get the following output:

                unable to change to /Users/xxx/00_create/data\
                r(170);

                The error code says:

                Return code 170
                unable to chdir
                (Unix and Mac.) cd was unable to change to the directory you
                typed because either it does not exist, it is protected, or it
                is not a directory.

                Can anyone tell me how to solve this?

                Thank you very much for your help.

                Kind regards

                Comment


                • #9
                  Hi, Marcel. Welcome to the list.

                  I think you have all tips in the error message.

                  Have you checked whether
                  1. the folder exists?
                  2. you have permission to edit it?
                  3. the commands are 100% accurate?

                  Tiago

                  Comment

                  Working...
                  X