Update destination file permissions after copying

This commit is contained in:
Giuseppe Criscione 2020-12-31 15:05:22 +01:00
parent 851b945560
commit a90df59e41

View File

@ -484,6 +484,7 @@ class FileSystem
static::assertExists($destination, false);
}
if (@copy($source, $destination)) {
@chmod($destination, @fileperms($source));
return true;
}
throw new FileSystemException(sprintf('Cannot copy file "%s": %s', $source, static::getLastErrorMessage()));
@ -505,6 +506,7 @@ class FileSystem
if (!static::exists($destination)) {
static::createDirectory($destination, true);
}
@chmod($destination, @fileperms($source));
try {
foreach (static::listContents($source, self::LIST_ALL) as $item) {
$sourceItemPath = static::joinPaths($source, $item);