You are here

function drupal_tempnam in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/includes/file.inc \drupal_tempnam()

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

Deprecated

in Drupal 8.0.x-dev, will be removed before Drupal 9.0.0. Use \Drupal\Core\File\FileSystem::tempnam().

Related topics

5 calls to drupal_tempnam()
file_unmanaged_save_data in core/includes/file.inc
Saves a file to the specified destination without invoking file API.
GDToolkit::save in core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
Writes an image resource to a destination file.
ImageItem::generateSampleValue in core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
Generates placeholder field values.
Tasks::connect in core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
Check if we can connect to the database.
update_manager_local_transfers_allowed in core/modules/update/update.manager.inc
Determines if file transfers will be performed locally.

File

core/includes/file.inc, line 1095
API for handling file uploads and server file management.

Code

function drupal_tempnam($directory, $prefix) {
  return \Drupal::service('file_system')
    ->tempnam($directory, $prefix);
}