title: How do I create a Google Drive folder with only a path name
body: <p>How do I create a folder in Google Drive from only a pathname? Preferably I need the code to not fail if either the folder or any of it's sub-folders already exist.</p>
  
  <p>In the script I'm working in I only have the path name to a folder that I need to create in Google Drive:</p>
  
  <pre><code>newFolder = '/Path/To My/New Folder/';
  </code></pre>
  
  <p>If I use the following code:</p>
  
  <pre><code>DocsList.createFolder(newFolder);
  </code></pre>
  
  <p>It will create a folder at the root level called <strong>"/Path/To My/New Folder/"</strong></p>
  
  <p>My understanding is the correct syntax would be:</p>
  
  <pre><code>DocsList.createFolder('Path').createFolder('To My').createFolder('New Folder');
  </code></pre>
  
  <p>However if I only know the path, do not know how many sub-folders the path could contain, and do not know which of the folders/ sub folders exist what code should I use to create the folder from only a path?</p>
  
  <p>Any suggestions much appreciated.</p>