Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Dec 19, 2023
1 parent 5812cb3 commit c17b3b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import fsutil
- [`get_file_size_formatted`](#get_file_size_formatted)
- [`get_filename`](#get_filename)
- [`get_parent_dir`](#get_parent_dir)
- [`get_permissions`](#get_permissions)
- [`get_unique_name`](#get_unique_name)
- [`is_dir`](#is_dir)
- [`is_empty`](#is_empty)
Expand Down Expand Up @@ -107,6 +108,7 @@ import fsutil
- [`replace_file`](#replace_file)
- [`search_dirs`](#search_dirs)
- [`search_files`](#search_files)
- [`set_permissions`](#set_permissions)
- [`split_filename`](#split_filename)
- [`split_filepath`](#split_filepath)
- [`split_path`](#split_path)
Expand Down Expand Up @@ -436,10 +438,17 @@ filename = fsutil.get_filename(path)
parent_dir = fsutil.get_parent_dir(path, levels=1)
```

#### `get_permissions`

```python
# Get the file/directory permissions.
permissions = fsutil.get_permissions(path)
```

#### `get_unique_name`

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

Expand Down Expand Up @@ -689,6 +698,13 @@ dirs = fsutil.search_dirs(path, pattern="**/*")
files = fsutil.search_files(path, pattern="**/*.*")
```

#### `set_permissions`

```python
# Set the file/directory permissions.
fsutil.set_permissions(path, 700)
```

#### `split_filename`

```python
Expand Down
6 changes: 3 additions & 3 deletions fsutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def get_parent_dir(path: PathIn, *, levels: int = 1) -> str:

def get_permissions(path: PathIn) -> int:
"""
Gets the file/directory permissions.
Get the file/directory permissions.
"""
path = _get_path(path)
assert_exists(path)
Expand All @@ -810,7 +810,7 @@ def get_unique_name(
separator: str = "-",
) -> str:
"""
Gets a unique name for a directory/file ath the given directory path.
Get a unique name for a directory/file ath the given directory path.
"""
path = _get_path(path)
assert_dir(path)
Expand Down Expand Up @@ -1297,7 +1297,7 @@ def search_files(path: PathIn, pattern: str = "**/*.*") -> list[str]:

def set_permissions(path: PathIn, value: int) -> None:
"""
Sets the file/directory permissions.
Set the file/directory permissions.
"""
path = _get_path(path)
assert_exists(path)
Expand Down

0 comments on commit c17b3b9

Please sign in to comment.