From bf8a934b56c03b785dfb774519fc7ae83eb39bc9 Mon Sep 17 00:00:00 2001 From: Volker Machon Date: Sun, 4 Feb 2018 13:11:05 +0100 Subject: [PATCH] Left trim the path separator in order to get `\League\Flysystem\Util\ContentListingFormatter::isDirectChild` return true and get the listing of the root folder of a share. fixes https://github.com/robgridley/flysystem-smb/issues/2 --- src/SmbAdapter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SmbAdapter.php b/src/SmbAdapter.php index 2df35da..d6031cd 100644 --- a/src/SmbAdapter.php +++ b/src/SmbAdapter.php @@ -383,7 +383,7 @@ protected function normalizeFileInfo(IFileInfo $file) { $normalized = [ 'type' => $file->isDirectory() ? 'dir' : 'file', - 'path' => $this->getFilePath($file), + 'path' => ltrim($this->getFilePath($file), $this->pathSeparator), 'timestamp' => $file->getMTime() ];