({{, (RefLink[FileNameSplit, paclet:ref/FileNameSplit])["name"] 
splits a file name into a list of parts.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[FileNameSplit, paclet:ref/FileNameSplit]) by default uses pathname separators and other conventions suitable for your operating system.

(RefLink[FileNameSplit, paclet:ref/FileNameSplit])[…,(RefLink[OperatingSystem, paclet:ref/OperatingSystem])->"os"] uses the conventions of the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".

Absolute file names that begin with a pathname separator yield a list of parts that starts with "".

Under Windows, the drive or share name is treated as the first part of the file name.

(RefLink[FileNameSplit, paclet:ref/FileNameSplit]) just operates on names of files; it does not actually search for the file specified.

(RefLink[FileNameSplit, paclet:ref/FileNameSplit])[(RefLink[File, paclet:ref/File])["name"]] is also supported.

(RefLink[FileNameSplit, paclet:ref/FileNameSplit])[(RefLink[URL, paclet:ref/URL])["file:///path"]] converts a file-based URL to a list of parts.

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Split a file name into its path components:

FileNameSplit[$InstallationDirectory]

On Windows, the share name is treated as a single unit:

FileNameSplit["\\\\server\\share\\path\\file"]

OpenersExampleSection1(Spacer1)Scope  (1)

Split name of the file specified by the (RefLink[File, paclet:ref/File]) object:

file=File[FileNameJoin[{"a","b","c"}]]

FileNameSplit[file]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[FileNameJoin, paclet:ref/FileNameJoin])  ▪  (RefLink[StringSplit, paclet:ref/StringSplit])  ▪  (RefLink[FileNameDepth, paclet:ref/FileNameDepth])  ▪  (RefLink[FileNameTake, paclet:ref/FileNameTake])  ▪  (RefLink[$OperatingSystem, paclet:ref/$OperatingSystem])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[File Operations, paclet:guide/FileOperations])}, {▪(RefLinkPlain[Operations on File Names, paclet:guide/OperationsOnFileNames])}, {▪(RefLinkPlain[String Manipulation, paclet:guide/StringManipulation])}, {▪(RefLinkPlain[Directories & Directory Operations, paclet:guide/DirectoriesAndDirectoryOperations])}, {▪(RefLinkPlain[Systems-Related String Operations, paclet:guide/SystemsRelatedStringOperations])}, {▪(RefLinkPlain[Text Analysis, paclet:guide/TextAnalysis])}})}})