Skip to content

Commit

Permalink
move update
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Jun 18, 2023
1 parent ca53292 commit de9dba2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/File.php
Expand Up @@ -540,8 +540,17 @@ public function copy($newFile)
*/
public function move($newRootPathFle)
{
$newFile = $this->copy($newRootPathFle);
$this->unlink();
$newFile = static::object($newRootPathFle);
$newFile->checkAndCreateDir();

if (!rename((string) $this->getPath(), (string) $newFile->getPath()))
{
throw new Exception("not move file: " . $this->getPath() . " into: " . $newFile->getPath());
}

//Это не правильно! Все зависает на файлах более 10 гб
/*$newFile = $this->copy($newRootPathFle);
$this->unlink();*/

return $newFile;
}
Expand Down

0 comments on commit de9dba2

Please sign in to comment.