equal
deleted
inserted
replaced
22 |
22 |
23 from .i18n import _ |
23 from .i18n import _ |
24 from . import ( |
24 from . import ( |
25 encoding, |
25 encoding, |
26 error, |
26 error, |
|
27 policy, |
27 pycompat, |
28 pycompat, |
28 ) |
29 ) |
|
30 |
|
31 osutil = policy.importmod(r'osutil') |
29 |
32 |
30 posixfile = open |
33 posixfile = open |
31 normpath = os.path.normpath |
34 normpath = os.path.normpath |
32 samestat = os.path.samestat |
35 samestat = os.path.samestat |
33 try: |
36 try: |
300 def checkosfilename(path): |
303 def checkosfilename(path): |
301 '''Check that the base-relative path is a valid filename on this platform. |
304 '''Check that the base-relative path is a valid filename on this platform. |
302 Returns None if the path is ok, or a UI string describing the problem.''' |
305 Returns None if the path is ok, or a UI string describing the problem.''' |
303 return None # on posix platforms, every path is ok |
306 return None # on posix platforms, every path is ok |
304 |
307 |
|
308 def getfstype(dirpath): |
|
309 '''Get the filesystem type name from a directory (best-effort) |
|
310 |
|
311 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. |
|
312 ''' |
|
313 return getattr(osutil, 'getfstype', lambda x: None)(dirpath) |
|
314 |
305 def setbinary(fd): |
315 def setbinary(fd): |
306 pass |
316 pass |
307 |
317 |
308 def pconvert(path): |
318 def pconvert(path): |
309 return path |
319 return path |