-
-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Description
What happened?
Trying to execute to_csv on windows.
When giving a path to the csv, an error showed up:
ErrorException
mkdir(): No such file or directory
at vendor\flow-php\filesystem\src\Flow\Filesystem\Local\NativeLocalFilesystem.php:171
167▕ throw new InvalidArgumentException("Pattern paths can't be written: " . $path->uri());
168▕ }
169▕
170▕ if (!$this->status($path->parentDirectory())) {
➜ 171▕ if (!\mkdir($concurrentDirectory = $path->parentDirectory()->path(), recursive: true) && !\is_dir($concurrentDirectory)) {
172▕ throw new RuntimeException(\sprintf('Directory "%s" was not created', $concurrentDirectory));
173▕ }
174▕ }
175▕
1 vendor\flow-php\filesystem\src\Flow\Filesystem\Local\NativeLocalFilesystem.php:171
2 vendor\flow-php\etl\src\Flow\ETL\Filesystem\FilesystemStreams.php:241
Flow\Filesystem\Local\NativeLocalFilesystem::writeTo(Object(Flow\Filesystem\Path))
So, i reduced it this test lines:
$path_string = storage_path() . DIRECTORY_SEPARATOR . 'output.csv';
$path = new Path($path_string);
(yes, it runs in a laravel environment)
Output is:
"C:\projekte\flowphpdemo\storage\output.csv" // app\Console\Commands\FlowTestCommand.php:40
"\C:\projekte\flowphpdemo\storage\output.csv" // app\Console\Commands\FlowTestCommand.php:40
You see, the string itself is ok, the path-object magically adds a \ in front and therefor, mkdir cannot work.
Plase fix
How to reproduce?
On Windows, to something with to_csvData required to reproduce bug locally
see above
Version
0.19.0
Relevant error output
ErrorException
mkdir(): No such file or directory
at vendor\flow-php\filesystem\src\Flow\Filesystem\Local\NativeLocalFilesystem.php:171
167▕ throw new InvalidArgumentException("Pattern paths can't be written: " . $path->uri());
168▕ }
169▕
170▕ if (!$this->status($path->parentDirectory())) {
➜ 171▕ if (!\mkdir($concurrentDirectory = $path->parentDirectory()->path(), recursive: true) && !\is_dir($concurrentDirectory)) {
172▕ throw new RuntimeException(\sprintf('Directory "%s" was not created', $concurrentDirectory));
173▕ }
174▕ }
175▕
1 vendor\flow-php\filesystem\src\Flow\Filesystem\Local\NativeLocalFilesystem.php:171
2 vendor\flow-php\etl\src\Flow\ETL\Filesystem\FilesystemStreams.php:241
Flow\Filesystem\Local\NativeLocalFilesystem::writeTo(Object(Flow\Filesystem\Path))Metadata
Metadata
Assignees
Labels
No labels