⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

get_extension

Function get_extension 

Source
pub fn get_extension(filename: &str) -> Option<&str>
Expand description

Extract the file extension from a filename, lowercased for comparison.

Returns the extension without the leading dot, or None if there is no extension. The returned slice borrows from filename.

§Examples (conceptual, no_std)

  • "readme.txt" -> Some("txt")
  • "Makefile" -> None
  • "archive.tar.gz" -> Some("gz")
  • ".hidden" -> None (dot-files with no further extension)