OSX : rmdir “permission denied” but directory removed

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I was trying to test the rmdir command by removing a test directory located in my Downloads directory. I have read and write rights on Downloads.



I issued rmdir -p /Users/myself/Downloads/test
and got rmdir: /Users/myself/Downloads: Permission denied
, but the test directory was deleted.
So why do I have this message? Should I care?



I'm using OSX Lion 10.7.3.










share|improve this question



























    up vote
    0
    down vote

    favorite












    I was trying to test the rmdir command by removing a test directory located in my Downloads directory. I have read and write rights on Downloads.



    I issued rmdir -p /Users/myself/Downloads/test
    and got rmdir: /Users/myself/Downloads: Permission denied
    , but the test directory was deleted.
    So why do I have this message? Should I care?



    I'm using OSX Lion 10.7.3.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I was trying to test the rmdir command by removing a test directory located in my Downloads directory. I have read and write rights on Downloads.



      I issued rmdir -p /Users/myself/Downloads/test
      and got rmdir: /Users/myself/Downloads: Permission denied
      , but the test directory was deleted.
      So why do I have this message? Should I care?



      I'm using OSX Lion 10.7.3.










      share|improve this question















      I was trying to test the rmdir command by removing a test directory located in my Downloads directory. I have read and write rights on Downloads.



      I issued rmdir -p /Users/myself/Downloads/test
      and got rmdir: /Users/myself/Downloads: Permission denied
      , but the test directory was deleted.
      So why do I have this message? Should I care?



      I'm using OSX Lion 10.7.3.







      command-line permissions osx directory rm






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 21 at 3:24









      Rui F Ribeiro

      36.7k1271116




      36.7k1271116










      asked Jun 10 '12 at 12:18









      politicus

      1116




      1116




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          From man rmdir:



           -p, --parents
          remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'


          So your rmdir call tries to delete test (succeeds), then tries to delete the parent directory Documents (or rather Downloads) and fails... I think. I'd rather have expected some "directory not empty" error, because why shouldn't you have the permissions to delete this folder?






          share|improve this answer






















          • Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
            – politicus
            Jun 10 '12 at 13:20











          • Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
            – sr_
            Jun 10 '12 at 13:31











          • I tried to delete the folder "Sites" via Finder and got that kind of message.
            – politicus
            Jun 10 '12 at 13:38










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f40431%2fosx-rmdir-permission-denied-but-directory-removed%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          From man rmdir:



           -p, --parents
          remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'


          So your rmdir call tries to delete test (succeeds), then tries to delete the parent directory Documents (or rather Downloads) and fails... I think. I'd rather have expected some "directory not empty" error, because why shouldn't you have the permissions to delete this folder?






          share|improve this answer






















          • Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
            – politicus
            Jun 10 '12 at 13:20











          • Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
            – sr_
            Jun 10 '12 at 13:31











          • I tried to delete the folder "Sites" via Finder and got that kind of message.
            – politicus
            Jun 10 '12 at 13:38














          up vote
          4
          down vote



          accepted










          From man rmdir:



           -p, --parents
          remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'


          So your rmdir call tries to delete test (succeeds), then tries to delete the parent directory Documents (or rather Downloads) and fails... I think. I'd rather have expected some "directory not empty" error, because why shouldn't you have the permissions to delete this folder?






          share|improve this answer






















          • Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
            – politicus
            Jun 10 '12 at 13:20











          • Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
            – sr_
            Jun 10 '12 at 13:31











          • I tried to delete the folder "Sites" via Finder and got that kind of message.
            – politicus
            Jun 10 '12 at 13:38












          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          From man rmdir:



           -p, --parents
          remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'


          So your rmdir call tries to delete test (succeeds), then tries to delete the parent directory Documents (or rather Downloads) and fails... I think. I'd rather have expected some "directory not empty" error, because why shouldn't you have the permissions to delete this folder?






          share|improve this answer














          From man rmdir:



           -p, --parents
          remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'


          So your rmdir call tries to delete test (succeeds), then tries to delete the parent directory Documents (or rather Downloads) and fails... I think. I'd rather have expected some "directory not empty" error, because why shouldn't you have the permissions to delete this folder?







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 10 '12 at 12:58

























          answered Jun 10 '12 at 12:46









          sr_

          12.8k3042




          12.8k3042











          • Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
            – politicus
            Jun 10 '12 at 13:20











          • Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
            – sr_
            Jun 10 '12 at 13:31











          • I tried to delete the folder "Sites" via Finder and got that kind of message.
            – politicus
            Jun 10 '12 at 13:38
















          • Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
            – politicus
            Jun 10 '12 at 13:20











          • Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
            – sr_
            Jun 10 '12 at 13:31











          • I tried to delete the folder "Sites" via Finder and got that kind of message.
            – politicus
            Jun 10 '12 at 13:38















          Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
          – politicus
          Jun 10 '12 at 13:20





          Thanks sr_ for your answer. You are right it is "Downloads" not "Documents". Maybe I can't delete "Downloads" because one just can't delete "Downloads" because of a "This folder is required by OS X" thing...
          – politicus
          Jun 10 '12 at 13:20













          Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
          – sr_
          Jun 10 '12 at 13:31





          Possibly, I don't know anything about how OS X alters the general "UNIX-like"-ness encountered everywhere else. :)
          – sr_
          Jun 10 '12 at 13:31













          I tried to delete the folder "Sites" via Finder and got that kind of message.
          – politicus
          Jun 10 '12 at 13:38




          I tried to delete the folder "Sites" via Finder and got that kind of message.
          – politicus
          Jun 10 '12 at 13:38

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f40431%2fosx-rmdir-permission-denied-but-directory-removed%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)