Last Updated: May 22, 2026
The static System.IO.Path class is the part of the BCL that knows how file and directory paths are spelled on the operating system the program is running on. Hand-concatenating strings with / or \ works on a developer's laptop and breaks the moment the same code runs on a different OS or hits a path with a trailing separator. This lesson covers the small set of Path methods that handle combining, decomposing, resolving, and normalizing paths, the rules that govern how those methods behave on Windows versus Linux and macOS, and the surprising corners (rooted segments, GetTempFileName security, separators inside otherwise-clean code) that bite people in production.