We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 780a993 commit c023b96Copy full SHA for c023b96
os.path/os/path.py
@@ -27,3 +27,11 @@ def exists(path):
27
28
# TODO
29
lexists = exists
30
+
31
+def isdir(path):
32
+ import stat
33
+ try:
34
+ mode = os.stat(path)[0]
35
+ return stat.S_ISDIR(mode)
36
+ except OSError:
37
+ return False
os.path/test_path.py
@@ -6,3 +6,10 @@
6
assert split("/foo") == ("/", "foo")
7
assert split("/foo/") == ("/foo", "")
8
assert split("/foo/bar") == ("/foo", "bar")
9
10
+assert exists("test_path.py")
11
+assert not exists("test_path.py--")
12
13
+assert isdir("os")
14
+assert not isdir("os--")
15
+assert not isdir("test_path.py")
0 commit comments