Skip to content

Commit c17b3b9

Browse files
committed
Update README.
1 parent 5812cb3 commit c17b3b9

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import fsutil
7474
- [`get_file_size_formatted`](#get_file_size_formatted)
7575
- [`get_filename`](#get_filename)
7676
- [`get_parent_dir`](#get_parent_dir)
77+
- [`get_permissions`](#get_permissions)
7778
- [`get_unique_name`](#get_unique_name)
7879
- [`is_dir`](#is_dir)
7980
- [`is_empty`](#is_empty)
@@ -107,6 +108,7 @@ import fsutil
107108
- [`replace_file`](#replace_file)
108109
- [`search_dirs`](#search_dirs)
109110
- [`search_files`](#search_files)
111+
- [`set_permissions`](#set_permissions)
110112
- [`split_filename`](#split_filename)
111113
- [`split_filepath`](#split_filepath)
112114
- [`split_path`](#split_path)
@@ -436,10 +438,17 @@ filename = fsutil.get_filename(path)
436438
parent_dir = fsutil.get_parent_dir(path, levels=1)
437439
```
438440

441+
#### `get_permissions`
442+
443+
```python
444+
# Get the file/directory permissions.
445+
permissions = fsutil.get_permissions(path)
446+
```
447+
439448
#### `get_unique_name`
440449

441450
```python
442-
# Gets a unique name for a directory/file ath the given directory path.
451+
# Get a unique name for a directory/file ath the given directory path.
443452
unique_name = fsutil.get_unique_name(path, prefix="", suffix="", extension="", separator="-")
444453
```
445454

@@ -689,6 +698,13 @@ dirs = fsutil.search_dirs(path, pattern="**/*")
689698
files = fsutil.search_files(path, pattern="**/*.*")
690699
```
691700

701+
#### `set_permissions`
702+
703+
```python
704+
# Set the file/directory permissions.
705+
fsutil.set_permissions(path, 700)
706+
```
707+
692708
#### `split_filename`
693709

694710
```python

fsutil/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def get_parent_dir(path: PathIn, *, levels: int = 1) -> str:
792792

793793
def get_permissions(path: PathIn) -> int:
794794
"""
795-
Gets the file/directory permissions.
795+
Get the file/directory permissions.
796796
"""
797797
path = _get_path(path)
798798
assert_exists(path)
@@ -810,7 +810,7 @@ def get_unique_name(
810810
separator: str = "-",
811811
) -> str:
812812
"""
813-
Gets a unique name for a directory/file ath the given directory path.
813+
Get a unique name for a directory/file ath the given directory path.
814814
"""
815815
path = _get_path(path)
816816
assert_dir(path)
@@ -1297,7 +1297,7 @@ def search_files(path: PathIn, pattern: str = "**/*.*") -> list[str]:
12971297

12981298
def set_permissions(path: PathIn, value: int) -> None:
12991299
"""
1300-
Sets the file/directory permissions.
1300+
Set the file/directory permissions.
13011301
"""
13021302
path = _get_path(path)
13031303
assert_exists(path)

0 commit comments

Comments
 (0)