public function move(FilesystemFolder $destination) {

		// already in destination folder, nothing to do

		if($destination !== $this->folder) {

			$oldpath	= $this->folder->getPath() . $this->filename;
			$newpath	= $destination->getPath() . $this->filename;
	
			if(@rename($oldpath, $newpath)) {

				$this->clearCacheEntries();
				
				// set new folder reference

				$this->folder = $destination;
	
				// re-read fileinfo

				$this->fileInfo	= new \SplFileInfo($newpath);

				self::$instances[$newpath] = $this;
				unset(self::$instances[$oldpath]);

				// @todo: check necessity of chmod
	
				@chmod($newpath, 0666 & ~umask());
				
			}
	
			else {
				throw new FilesystemFileException("Moving from '$oldpath' to '$newpath' failed.", FilesystemFileException::FILE_RENAME_FAILED);
			}

		}

		return $this;
	}
public function move(FilesystemFolder $destination) {

		// already in destination folder, nothing to do

		if($destination !== $this->folder) {

			$oldpath	= $this->folder->getPath() . $this->filename;
			$newpath	= $destination->getPath() . $this->filename;
	
			if(@rename($oldpath, $newpath)) {

				$this->clearCacheEntries();
				
				// set new folder reference

				$this->folder = $destination;
	
				// re-read fileinfo

				$this->fileInfo	= new \SplFileInfo($newpath);

				self::$instances[$newpath] = $this;
				unset(self::$instances[$oldpath]);

				// @todo: check necessity of chmod
	
				@chmod($newpath, 0666 & ~umask());
				
			}
	
			else {
				throw new FilesystemFileException("Moving from '$oldpath' to '$newpath' failed.", FilesystemFileException::FILE_RENAME_FAILED);
			}

		}

		return $this;
	}
public function move ( FilesystemFolder $ destination ) { // already in destination folder, nothing to do if ( $ destination !== $ this -> folder ) { $ oldpath = $ this -> folder -> getPath ( ) . $ this -> filename ; $ newpath = $ destination -> getPath ( ) . $ this -> filename ; if ( @ rename ( $ oldpath , $ newpath ) ) { $ this -> clearCacheEntries ( ) ; // set new folder reference $ this -> folder = $ destination ; // re-read fileinfo $ this -> fileInfo = new \ SplFileInfo ( $ newpath ) ; self :: $ instances [ $ newpath ] = $ this ; unset ( self :: $ instances [ $ oldpath ] ) ; // @todo: check necessity of chmod @ chmod ( $ newpath , 0666 & ~ umask ( ) ) ; } else { throw new FilesystemFileException ( "Moving from '$oldpath' to '$newpath' failed." , FilesystemFileException :: FILE_RENAME_FAILED ) ; } } return $ this ; }
move file into new folder,
orphaned cache entries are deleted, new cache entries are not generated

@param FilesystemFolder $destination
@return \vxPHP\File\FilesystemFile
@throws FilesystemFileException
move file into new folder orphaned cache entries are deleted new cache entries are not generated