M16) Identifying parts of a file path

A program saves a report at the file path shown in Listing 1. Each / separates names. The first / is the root directory, the top-level folder where this path begins.

Listing 1: Complete path of the saved report.
/course/reports/orders.summary.csv

Use the definitions in Table 1 to identify the parts of the report’s path.

Table 1: Parts to identify in the report’s path.
Part What to identify
Parent directory The folder immediately containing the file, written as its complete path.
File name The name after the last /, including its extension.
Stem The file name with only its final suffix removed.
Final suffix (file extension) The last dot and everything after it.

Which choice correctly identifies all four parts?

  • Parent /course/reports; file name orders.summary.csv.
    Stem orders; suffix .summary.csv.
  • Parent /course; file name reports/orders.summary.csv.
    Stem orders.summary; suffix .csv.
  • Parent /course/reports; file name orders.summary.csv.
    Stem orders.summary; suffix .csv.
  • Parent /course/reports; file name orders.summary.
    Stem orders.summary.csv; suffix csv.
  • Directory separators and dots have different roles: / separates path components, while a filename may contain several dots.
  • For example, result.final.txt has the stem result.final and the final suffix .txt. Removing the final suffix leaves earlier dots in the stem.