/** * Returns a new FileSys instance relative to this directory * * @param \r8\FileSys|String $subPath The subpath to search for * @return \r8\FileSys A new filesys object */ public function getSubPath($subPath) { if (!$this->dirExists()) { throw new \r8\Exception\Variable("Dir", "No directory has been set for this instance"); } $subPath = new \r8\FileSys\File($subPath); $subPath->resolve($this->getPath()); if ($subPath->isDir()) { return new \r8\FileSys\Dir($subPath); } else { return $subPath; } }