From caa1b279acd03bbf6543e5146b24084d221a73e7 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Tue, 27 Jan 2015 04:25:20 +0200 Subject: [PATCH] os.path: Implement dirname(), basename(). --- os.path/os/path.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/os.path/os/path.py b/os.path/os/path.py index 790a3ba7..a03cd04b 100644 --- a/os.path/os/path.py +++ b/os.path/os/path.py @@ -28,6 +28,12 @@ def split(path): head = "/" return (head, r[1]) +def dirname(path): + return split(path)[0] + +def basename(path): + return split(path)[1] + def exists(path): return os.access(path, os.F_OK)