mirror of
https://github.com/danog/file.git
synced 2024-11-26 20:04:51 +01:00
Don't fail if directory exists on recursive creation
This commit is contained in:
parent
a631384d3e
commit
b8e3314417
@ -233,6 +233,13 @@ final class EioFilesystemDriver implements FilesystemDriver
|
||||
|
||||
try {
|
||||
$deferred->getFuture()->await();
|
||||
} catch (FilesystemException $exception) {
|
||||
$result = $this->getStatus($path);
|
||||
if ($result !== null && ($result['mode'] & 0040000)) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
} finally {
|
||||
$this->poll->done();
|
||||
}
|
||||
|
@ -266,6 +266,13 @@ final class UvFilesystemDriver implements FilesystemDriver
|
||||
|
||||
try {
|
||||
$deferred->getFuture()->await();
|
||||
} catch (FilesystemException $exception) {
|
||||
$result = $this->getStatus($path);
|
||||
if ($result !== null && ($result['mode'] & 0040000)) {
|
||||
return;
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
} finally {
|
||||
$this->poll->done();
|
||||
}
|
||||
|
@ -386,13 +386,20 @@ abstract class FilesystemDriverTest extends FilesystemTest
|
||||
$this->assertTrue($this->driver->exists($dir));
|
||||
}
|
||||
|
||||
public function testCreateDirectoryRecursivelyExists(): void
|
||||
public function testCreateDirectoryRecursivelyExistsDir(): void
|
||||
{
|
||||
$this->expectNotToPerformAssertions();
|
||||
|
||||
$this->driver->createDirectoryRecursively(__DIR__, 0764);
|
||||
}
|
||||
|
||||
public function testCreateDirectoryRecursivelyExistsFile(): void
|
||||
{
|
||||
$this->expectException(FilesystemException::class);
|
||||
|
||||
$this->driver->createDirectoryRecursively(__FILE__, 0764);
|
||||
}
|
||||
|
||||
public function testCreateDirectoryFailsOnNonexistentPath(): void
|
||||
{
|
||||
$fixtureDir = Fixture::path();
|
||||
|
Loading…
Reference in New Issue
Block a user