title: OSError: [Errno 30] Read-only file system: '/User'. macOS Catalina
body: <p>I was coding <strong>sorter</strong> for downloads folder. I'm getting this error, I tried to change permissions: <br />
  <code>chmod: Unable to change file mode on Users: Operation not permitted</code></p>
  <pre><code>import os
  
  from_dir = os.path.dirname('/Users/user/Downloads/')
  working_dir = os.walk(from_dir)
  to_dir = os.path.dirname('/User/user/Downloads/New Folder/')
  
  
  def move(folder):
      for roots, dirs, files in folder:
          for file in files:
              src_folder = from_dir + '/' + file
              to_folder = to_dir + '/' + file
              if not os.path.exists(to_dir):
                  os.makedirs(to_dir)
              os.rename(src_folder, to_folder)
  
  
  move(working_dir)
  </code></pre>
  <p>Maybe there is another way to write this code just without touching root folders?</p>
  <p>Full error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Users/beknazarnurbek/Documents/PycharmProjects/Move Files/move.py&quot;, line 19, in &lt;module&gt;
      move(working_dir)
    File &quot;/Users/beknazarnurbek/Documents/PycharmProjects/Move Files/move.py&quot;, line 14, in move
      os.makedirs(to_dir)
    File &quot;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/os.py&quot;, line 211, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File &quot;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/os.py&quot;, line 211, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File &quot;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/os.py&quot;, line 211, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File &quot;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/os.py&quot;, line 221, in makedirs
      mkdir(name, mode)
  OSError: [Errno 30] Read-only file system: '/User'
  </code></pre>