From 34931964b6c48b9c053c1025f2af890aebe184e8 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 14 May 2014 17:52:37 +0300 Subject: [PATCH] os.path: Add exists(). --- 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 1162a1b1..e91e17d9 100644 --- a/os.path/os/path.py +++ b/os.path/os/path.py @@ -1,3 +1,6 @@ +import os + + def normcase(s): return s @@ -18,3 +21,6 @@ def split(path): if not head: head = "/" return (head, r[1]) + +def exists(path): + return os.access(path, os.F_OK)