You are here

public function S3fsFileService::tempnam in S3 File System 8.3

Same name and namespace in other branches
  1. 4.0.x src/S3fsFileService.php \Drupal\s3fs\S3fsFileService::tempnam()

Creates a file with a unique filename in the specified directory.

PHP's tempnam() does not return a URI like we want. This function will return a URI if given a URI, or it will return a filepath if given a filepath.

Compatibility: normal paths and stream wrappers.

Parameters

string $directory: The directory where the temporary filename will be created.

string $prefix: The prefix of the generated temporary filename. Note: Windows uses only the first three characters of prefix.

Return value

string|bool The new temporary filename, or FALSE on failure.

Overrides FileSystemInterface::tempnam

See also

tempnam()

https://www.drupal.org/node/515192

1 call to S3fsFileService::tempnam()
S3fsFileService::saveData in src/S3fsFileService.php
Saves a file to the specified destination without invoking file API.

File

src/S3fsFileService.php, line 179

Class

S3fsFileService
Provides helpers to operate on files and stream wrappers.

Namespace

Drupal\s3fs

Code

public function tempnam($directory, $prefix) {
  return $this->decorated
    ->tempnam($directory, $prefix);
}