conventions.io

Tech Challenge

2026-08-26

🦀

Daily Tech Challenge

Rust

medium
Question 1 of 5

On a Unix-like platform, what does this program print, joining paths with Path::join and inspecting a multi-dot file name? (the four output lines are shown separated by " / ")

Example
use std::path::Path;

fn main() {
    let base = Path::new("/home/ana/docs");
    let a = base.join("notes.tar.gz");
    let b = base.join("/etc/passwd");

    println!("{}", a.display());
    println!("{}", b.display());
    println!("{:?}", a.extension());
    println!("{:?}", a.file_stem());
}

Wednesday, August 26, 2026 · A new challenge drops every day