Function dirname [src]

Strip the last component from a file path. If the path is a file in the current directory (no directory component) then returns null. If the path is the root directory, returns null.

Prototype

pub fn dirname(path: []const u8) ?[]const u8

Parameters

path: []const u8

Source

pub fn dirname(path: []const u8) ?[]const u8 { if (native_os == .windows) { return dirnameWindows(path); } else { return dirnamePosix(path); } }