gives the last path element in the file name "name".
gives the first n path elements in the file name "name".
gives the last n path elements in the file name "name".
gives elements m through n in the file name "name".
Details and Options
- FileNameTake by default assumes that path elements are separated by pathname separators suitable for your operating system.
- FileNameTake[…,OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".
- FileNameTake just operates on names of files; it does not actually search for the file specified.
- If more elements are requested than are present, FileNameTake just gives those that are present.
- FileNameTake[File["name"],…] is also supported.
Examplesopen allclose all
Basic Examples (4)
Extract a path element from the file name specified by the File object: