Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » system facilities » minimizeFilename
next | previous | forward | backward | up | index | toc

# minimizeFilename -- minimize a file name

- Usage:
    `minimizeFilename fn`
- Inputs:
  - fn, a path to a file
- Outputs:
  - a minimized path, equivalent to fn

## Description

    i1 : minimizeFilename "a/b/c/../d"

    o1 = a/b/d

    i2 : minimizeFilename "../../../../../../"

    o2 = /build/

Paths of the form foo/x/../bar, are shortened to foo/bar without checking the file system to see whether x is a symbolic link. For the other behavior, see realpath.

## See also

- File -- the class of all files
- relativizeFilename -- relativize a file name
- baseFilename -- the base part of a filename or path
- toAbsolutePath -- the absolute path version of a file name
- searchPath -- search a path for a file
- path -- list of directories to look in

## For the programmer

The object minimizeFilename is a compiled function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_system.m2:1386:0.