Definition

file_check_path(&$path)
drupal/includes/file.inc, line 127

Description

Checks path to see if it is a directory, or a dir/file.

Parameters

$path

Related topics

Namesort iconDescription
File interfaceCommon file handling functions.

Code

function file_check_path(&$path) {
  // Check if path is a directory.
  if (file_check_directory($path)) {
    return '';
  }

  // Check if path is a possible dir/file.
  $filename = basename($path);
  $path = dirname($path);
  if (file_check_directory($path)) {
    return $filename;
  }

  return false;
}