function drush_trim_path

8.0.x filesystem.inc drush_trim_path($path, $os = NULL)
6.x filesystem.inc drush_trim_path($path, $os = NULL)
7.x filesystem.inc drush_trim_path($path, $os = NULL)
5.x filesystem.inc drush_trim_path($path, $os = NULL)
master filesystem.inc drush_trim_path($path, $os = NULL)

Remove the trailing DIRECTORY_SEPARATOR from a path. Will actually remove either / or \ on Windows.

Related topics

5 calls to drush_trim_path()
drush_normalize_path in includes/filesystem.inc
Makes sure the path has only path separators native for the current operating system
drush_preflight_backup_dir in includes/filesystem.inc
Decide where our backup directory should go
drush_sitealias_evaluate_path in includes/sitealias.inc
Evaluate a path from its shorthand form to a literal path usable by rsync.
drush_tempdir in includes/filesystem.inc
Creates a temporary directory and return its path.
package_handler_download_project in commands/pm/package_handler/wget.inc
Download a project.

File

includes/filesystem.inc, line 71
Filesystem utilities.

Code

function drush_trim_path($path, $os = NULL) {
  if (drush_is_windows($os)) {
    return rtrim($path, '/\\');
  }
  else {
    return rtrim($path, '/');
  }
}