Creates a temporary file path that will be automatically purged at the
end of the test.

@param string $name The file name.

@return string The file path.

@throws FileSystemException If the file could not be created.
179111
public function createFile($name = null)
    {
        if (null === $name) {
            if (false === ($file = tempnam(sys_get_temp_dir(), 'tst'))) {
                throw FileSystemException::lastError($name);
            }

            $this->purgePaths[] = $file;
        } else {
            if (false === touch(
                $file = $this->createDir() . DIRECTORY_SEPARATOR . $name
            )){
                throw FileSystemException::lastError($file);
            }
        }

        return $file;
    }
758227
protected function getDestenationFile($name, $path)
    {
        if (!empty($path)) {
            $path = Helpers::getPathWithSlash(ucfirst($path));
        }

        return app_path(Config::getModelsPath($path . $name . '.php'));
    }
962408
private function findPartialFile($name)
    {
        foreach ($this->partialDirs as $dir) {
            $file = $this->createPartialPath($dir, $name);

            if (is_file($file)) {
                return $file;
            }
        }

        return false;
    }
814289
public function lastModified($name)
    {
        if (! $this->files->exists($name)) {
            throw new FileNotFoundException("$name does not exist");
        }
        return $this->files->lastModified($name);
    }
1298203
protected function getPath($name, $path)
    {
        $timestamp = Carbon::now();

        if (in_array($timestamp, $this->usedTimestamps)) {
            $timestamp->addSecond();
        }
        $this->usedTimestamps[] = $timestamp;

        return $path . '/' . $timestamp->format('Y_m_d_His') . '_' . $this->getName($name) . '.php';
    }
717912
public function get($name)
    {
        // create a loader by the same path and name.
        if(!isset($this->pathRegistry[$name]))
            throw new \Exedra\Exception\NotFoundException('Path with registry ['.$name.'] does not exist.');

        return $this->pathRegistry[$name];
    }
37113
public function getPathToLogFile($name = 'm62')
    {
        if (is_null($this->log_path)) {
            $this->log_path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'logs') . DIRECTORY_SEPARATOR . $name . '.log';
        }
        
        return $this->log_path;
    }
662660
public function createDirectory($name)
    {
        // We're not allowing dots
        if ('.' == $name || '..' == $name) {
            throw new DAV\Exception\Forbidden('Permission denied to . and ..');
        }
        $newPath = $this->path.'/'.$name;
        mkdir($newPath);
        clearstatcache(true, $newPath);
    }
1199644
protected function getPath($name)
    {
        $name = Str::replaceFirst($this->rootNamespace(), '', $name);

        return $this->laravel['path'].'/'.str_replace('\\', '/', $name).'.php';
    }
892059
protected function getExtendFile($name) {
        if (strpos($name, '@') === 0) {
            return $this->factory->invokeTheme('getFile', [substr($name, 1)]);
        }
        if (strpos($name, './') === 0) {
            return $this->file->getDirectory()
                ->getFile($this->factory->fileSuffix(substr($name, 2)));
        }
        if (strpos($name, '../') === 0) {
            return $this->file->getDirectory()->parent()
                ->getFile($this->factory->fileSuffix($name));
        }
        return $name;
    }
1355041
protected function _mkdir($path, $name) {
		$path = $path.'/'.$name;
		if (ftp_mkdir($this->connect, $path) === false) {
			return false;
		} 
		
		$this->options['dirMode'] && @ftp_chmod($this->connect, $this->options['dirMode'], $path);
		return $path;
	}
623271
public function getPath($name)
    {
        return \array_key_exists($name, $this->paths) ? $this->paths[$name] : null;
    }
739578
public function rename($name)
    {
        $this->guardDeletedFile();

        // If there is any slash character in new name, Selectel
        // will create new virtual directory and copy file to
        // this new one. Such behaviour may be unexpected.

        if (count(explode('/', $name)) > 1) {
            throw new InvalidArgumentException('File name can not contain "/" character.');
        }

        $destination = $this->directory().'/'.$name;

        $response = $this->api->request('PUT', $this->absolutePath($destination), [
            'headers' => [
                'X-Copy-From' => $this->absolutePath(),
                'Content-Length' => 0,
            ],
        ]);

        if ($response->getStatusCode() !== 201) {
            throw new ApiRequestFailedException(
                'Unable to rename file from "'.$this->name().'" to "'.$name.'" (path: "'.$this->directory().'").',
                $response->getStatusCode()
            );
        }

        // Since Selectel Storage does not provide such method as "rename",
        // we need to delete original file after copying. Also, "deleted"
        // flag needs to be reverted because file was actually renamed.

        $this->delete();
        $this->deleted = false;

        return $this->data['name'] = $destination;
    }
1048201
private function createDirectory($path = '', $name = '')
    {
        $directory = new ArrayObject();
        $directory['name'] = $name;
        $directory['real_path'] = $path;
        $directory['directories'] = [];
        $directory['files'] = [];

        return $directory;
    }
1183055
public function delete($name)
  {
    $path = $this->_getPath($name);
    
    if (file_exists($path)) {
      $result = @unlink($path);
    } else {
      $result = false;
    }
    
    return $result;
  }
792425
protected function makeFromPath($name, $path)
    {
        if (!$this->get($name)) {

            $params = [
                'name' => $name,
                'path' => rtrim($path, '/') . '/' . $name
            ];

            $module = IOC::resolve('Module', $params);
            $this->add($module->getName(), $module->create());

            return $module;
        }

        return null;
    }
799725
protected function getChild(string $name): Path {
    $full_path = "{$this->path}/$name";

    if($this->driver->isDir($full_path)) {
      return $this->driver->getDirectory($full_path);
    }

    return $this->driver->getFile($full_path);
  }