title: cp: cannot create directory : No such file or directory
body: <p>Hi<br>I am trying to copy a folder from a source to a destination but I am getting the following error:<br></p>
  
  <pre><code>cp: cannot create directory ‘/home/Workspace/Release/addons/’: No such file or directory
  </code></pre>
  
  <p>I entered the following command:</p>
  
  <pre><code>cp -R /home/Workspace/Dev/user1/addons/account /home/Workspace/Release/addons/
  </code></pre>
  
  <p>I tried the same command with different folders and it worked fine.<br></p>
  
  <pre><code>cp -R /home/Desktop/file_transfer/f1/ff1 /home/Desktop/file_transfer/f2/
  </code></pre>
  
  <p><br>
  EDIT :<br>Q2. When I pass the command in the following code:</p>
  
  <pre><code>import os
  import re
  dest = "/home/Workspace/Release/addons/"
  root = "/home/Workspace/Dev/user1/addons/"
  f = open("/home/appslab/Desktop/main/FTP/release.conf.text", 'r')
  for line in f:
      filepath = root+line
      command = "cp -R "+str(filepath)+"\ "+str(dest)
      print(command)
      os.system(command)
  </code></pre>
  
  <p>I am getting the following error:</p>
  
  <pre><code>~/Desktop/FTP$ sudo python oswalk.py
  cp -R /home/appslab/Workspace/PythonDevserver/appslab/addons/account
   /home/appslab/Workspace/PythonRelease/addons
  cp: missing destination file operand after ‘/home/appslab/Workspace/PythonDevserver/appslab/addons/account’
  Try 'cp --help' for more information.
  sh: 2: /home/appslab/Workspace/PythonRelease/addons: Permission denied
  </code></pre>
  
  <p>The <code>command</code> that I am passing to <code>os.system()</code>, in that the <code>dest</code> is showing up on the next line.<br>Can anyone tell me what the problem is?<br>Thank you.<br>
  EDIT2:<br>Permissions for that directory:</p>
  
  <pre><code>drwxrwxr-x 363 user1 user1  16384 Sep 16 21:57 addons
  </code></pre>
  
  <p>EDIT3: <code>Fix for Q2</code> :</p>
  
  <pre><code>command = `str("cp -R ")` + str(filepath)+"\ "+str(dest)
  </code></pre>