FileNameDepth
FileNameDepth["name"]
gives the number of path elements in the file name "file".
Details and Options
- FileNameDepth["a/b/c"] gives 3.
- FileNameDepth by default assumes pathname separators and other conventions suitable for your operating system.
- FileNameDepth[…,OperatingSystem->"os"] uses the conventions of the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".
- FileNameDepth just operates on names of files; it does not actually search for the file specified.
- FileNameDepth[File["name"]] is also supported.
Examples
open allclose allBasic Examples (3)
Scope (1)
Find the number of path elements in the file name specified by the File object:
Wolfram Research (2008), FileNameDepth, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameDepth.html (updated 2016).
Text
Wolfram Research (2008), FileNameDepth, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameDepth.html (updated 2016).
CMS
Wolfram Language. 2008. "FileNameDepth." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/FileNameDepth.html.
APA
Wolfram Language. (2008). FileNameDepth. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileNameDepth.html