diff --git a/src/GoogleDriveAdapter.php b/src/GoogleDriveAdapter.php index 87093f3..439af3b 100644 --- a/src/GoogleDriveAdapter.php +++ b/src/GoogleDriveAdapter.php @@ -477,6 +477,20 @@ public function deleteDir($dirname) */ public function createDir($dirname, Config $config, $internalCall = false) { + try { + $meta = $this->getMetadata($dirname); + } catch (FileNotFoundException $e) { + $meta = false; + } + + if ($meta !== false) { + return [ + 'path' => $meta['path'], + 'filename' => $meta['filename'], + 'extension' => $meta['extension'] + ]; + } + list($pdir, $name) = $this->splitPath($dirname, false); if($this->useDisplayPaths) { if($pdir !== $this->root) {