##// END OF EJS Templates
util: implement a faster os.path.split for posix systems...
Bryan O'Sullivan -
r17560:9ee25d7b default
parent child Browse files
Show More
@@ -20,6 +20,16 b' expandglobs = False'
20 20 umask = os.umask(0)
21 21 os.umask(umask)
22 22
23 def split(p):
24 '''Same as os.path.split, but faster'''
25 ht = p.rsplit('/', 1)
26 if len(ht) == 1:
27 return '', p
28 nh = ht[0].rstrip('/')
29 if nh:
30 return nh, ht[1]
31 return ht
32
23 33 def openhardlinks():
24 34 '''return true if it is safe to hold open file handles to hardlinks'''
25 35 return True
@@ -62,6 +62,7 b' setflags = platform.setflags'
62 62 setsignalhandler = platform.setsignalhandler
63 63 shellquote = platform.shellquote
64 64 spawndetached = platform.spawndetached
65 split = platform.split
65 66 sshargs = platform.sshargs
66 67 statfiles = platform.statfiles
67 68 termwidth = platform.termwidth
@@ -20,6 +20,7 b' samedevice = win32.samedevice'
20 20 samefile = win32.samefile
21 21 setsignalhandler = win32.setsignalhandler
22 22 spawndetached = win32.spawndetached
23 split = os.path.split
23 24 termwidth = win32.termwidth
24 25 testpid = win32.testpid
25 26 unlink = win32.unlink
General Comments 0
You need to be logged in to leave comments. Login now