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