Results for “PATH”
Small, practical examples. Search by task or narrow things down below.
Build a portable file path
Combine directory and filename using the platform separator.
Join-Path✓ Tested
Calculate a lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Change a path’s extension
Change a path’s extension in a complete Rust program using the standard library.
Rust✓ Tested
Create a portable relative path
PowerShell: Create a portable relative path using PowerShell 7.
PowerShell✓ Tested
Extract a filename from a path
Linux Commands: Use basename with an explicit suffix when removing a known extension.
Linux Commands✓ Tested
Extract a parent directory from a path
Linux Commands: Use dirname without needing the path to exist.
Linux Commands✓ Tested
Extract a parent path with parameter expansion
Bash Scripts: Percent removes the shortest matching slash-and-suffix portion.
Bash Scripts✓ Tested
Extract a route path variable
Extract a route path variable using a complete Go program with explicit sample inputs.
Go✓ Tested
Find the final path separator
C: strrchr locates the last matching character without modifying the input.
C✓ Tested
Inspect a path’s filename and extension
Inspect a path’s filename and extension in a complete Rust program using the standard library.
Rust✓ Tested
Join portable path components
Join portable path components using a complete Go program with explicit sample inputs.
Go✓ Tested
List paths changed on a feature branch since its merge base
Git: A three-dot diff compares the branch tip with the common ancestor.
Git✓ Tested