0

This is a terminology question.

Say you have a path like C:\foo\bar\MyFolder\

foo, bar, and MyFolder are all individual directories, also known as folders, right? And they're arranged in a hierarchical directory tree, right?

However, the full path C:\foo\bar\MyFolder\ may also be referred to as a directory. For example, in C# there's a method called Directory.GetDirectories() that returns directories in full path form.

Is there an unambiguous way to refer to the individual items in the path (foo, bar, and MyFolder) that couldn't also mean the full paths ending in those items (C:\foo\, C:\foo\bar\, and C:\foo\bar\MyFolder\)? I mean a word like directory or folder that means only the first thing and can't mean the second.

1
  • 1
    The problem is the same for files. Loosely, you can talk about a file/directory path to mean the full path, and a file/directory name to mean the last component of the path, but whether you can rely on this to be universally understood is another matter. If you are writing anything of some length, you can always define your terms at the head of your piece.
    – AFH
    Sep 1, 2017 at 16:30

1 Answer 1

1

Is there an unambiguous way to refer to the individual items in the path

Microsoft refers to these as components:

However, each file system, such as NTFS, CDFS, exFAT, UDFS, FAT, and FAT32, can have specific and differing rules about the formation of the individual components in the path to a directory or file.

And:

Use a backslash \ to separate the components of a path. The backslash divides the file name from the path to it, and one directory name from another directory name in a path.

Source Naming Files, Paths, and Namespaces

So you would name them as Path Components.

A full File Path consists of the following components:

  • A drive specification
  • One or more directory components (delimited by \ characters)
  • A file name component
  • A file extension component (starting with the last . character in the full filename).
2
  • But how do you refer specifically the last directory component? Sep 3, 2017 at 19:48
  • 1
    @KyleDelaney I would say the last or final directory component
    – DavidPostill
    Sep 3, 2017 at 19:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .