384 """Check that the base-relative path is a valid filename on this platform. |
384 """Check that the base-relative path is a valid filename on this platform. |
385 Returns None if the path is ok, or a UI string describing the problem.""" |
385 Returns None if the path is ok, or a UI string describing the problem.""" |
386 return None # on posix platforms, every path is ok |
386 return None # on posix platforms, every path is ok |
387 |
387 |
388 |
388 |
389 def getfsmountpoint(dirpath: bytes) -> Optional[bytes]: |
389 def getfsmountpoint(path: bytes) -> Optional[bytes]: |
390 """Get the filesystem mount point from a directory (best-effort) |
390 """Get the filesystem mount point from a directory (best-effort) |
391 |
391 |
392 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. |
392 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. |
393 """ |
393 """ |
394 return getattr(osutil, 'getfsmountpoint', lambda x: None)(dirpath) |
394 return getattr(osutil, 'getfsmountpoint', lambda x: None)(path) |
395 |
395 |
396 |
396 |
397 def getfstype(dirpath: bytes) -> Optional[bytes]: |
397 def getfstype(path: bytes) -> Optional[bytes]: |
398 """Get the filesystem type name from a directory (best-effort) |
398 """Get the filesystem type name from a directory (best-effort) |
399 |
399 |
400 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. |
400 Returns None if we are unsure. Raises OSError on ENOENT, EPERM, etc. |
401 """ |
401 """ |
402 return getattr(osutil, 'getfstype', lambda x: None)(dirpath) |
402 return getattr(osutil, 'getfstype', lambda x: None)(path) |
403 |
403 |
404 |
404 |
405 def get_password() -> bytes: |
405 def get_password() -> bytes: |
406 return encoding.strtolocal(getpass.getpass('')) |
406 return encoding.strtolocal(getpass.getpass('')) |
407 |
407 |