Skip to content

Commit caa1b27

Browse files
committed
os.path: Implement dirname(), basename().
1 parent 0b53579 commit caa1b27

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

os.path/os/path.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ def split(path):
2828
head = "/"
2929
return (head, r[1])
3030

31+
def dirname(path):
32+
return split(path)[0]
33+
34+
def basename(path):
35+
return split(path)[1]
36+
3137
def exists(path):
3238
return os.access(path, os.F_OK)
3339

0 commit comments

Comments
 (0)