OXIESEC PANEL
- Current Dir:
/
/
usr
/
local
/
lib
/
python3.6
/
dist-packages
/
filelock
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 06:26:52 AM
rwxrwxr-x
📄
__init__.py
1.21 KB
05/09/2024 06:58:25 AM
rw-r--r--
📁
__pycache__
-
05/09/2024 06:58:27 AM
rwxr-xr-x
📄
_api.py
8.19 KB
05/09/2024 06:58:25 AM
rw-r--r--
📄
_error.py
362 bytes
05/09/2024 06:58:25 AM
rw-r--r--
📄
_soft.py
1.58 KB
05/09/2024 06:58:25 AM
rw-r--r--
📄
_unix.py
1.38 KB
05/09/2024 06:58:25 AM
rw-r--r--
📄
_util.py
558 bytes
05/09/2024 06:58:25 AM
rw-r--r--
📄
_windows.py
1.69 KB
05/09/2024 06:58:25 AM
rw-r--r--
📄
py.typed
0 bytes
05/09/2024 06:58:25 AM
rw-r--r--
📄
version.py
142 bytes
05/09/2024 06:58:25 AM
rw-r--r--
Editing: _util.py
Close
import os import stat def raise_on_exist_ro_file(filename: str) -> None: try: file_stat = os.stat(filename) # use stat to do exists + can write to check without race condition except OSError: return None # swallow does not exist or other errors if file_stat.st_mtime != 0: # if os.stat returns but modification is zero that's an invalid os.stat - ignore it if not (file_stat.st_mode & stat.S_IWUSR): raise PermissionError(f"Permission denied: {filename!r}") __all__ = [ "raise_on_exist_ro_file", ]