Skip to content

Commit

Permalink
Rename set_permissions argument to value.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Dec 19, 2023
1 parent 5c14e6f commit 5812cb3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fsutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,15 +1295,13 @@ def search_files(path: PathIn, pattern: str = "**/*.*") -> list[str]:
return _filter_paths(path, _search_paths(path, pattern), predicate=is_file)


def set_permissions(path: PathIn, permissions: int) -> None:
def set_permissions(path: PathIn, value: int) -> None:
"""
Sets the file/directory permissions.
"""
path = _get_path(path)
assert_exists(path)
# if permissions > 0o777:
# decimal value, convert it to octal
permissions = int(str(permissions), 8) & 0o777
permissions = int(str(value), 8) & 0o777
os.chmod(path, permissions)


Expand Down

0 comments on commit 5812cb3

Please sign in to comment.