4436
4436
except ImportError:
4439
class _PosixPermissionsFeature(Feature):
4443
# create temporary file and check if specified perms are maintained.
4446
write_perms = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
4447
f = tempfile.mkstemp(prefix='bzr_perms_chk_')
4450
os.chmod(name, write_perms)
4452
read_perms = os.stat(name).st_mode & 0777
4454
return (write_perms == read_perms)
4456
return (os.name == 'posix') and has_perms()
4458
def feature_name(self):
4459
return 'POSIX permissions support'
4461
posix_permissions_feature = _PosixPermissionsFeature()