https://github.com/nivindulakshitha/file-stats
FileOps: Retrieve file stats with Python utility. Handle size, ownership, timestamps. Ensure accurate file paths
https://github.com/nivindulakshitha/file-stats
pyhton
Last synced: 7 days ago
JSON representation
FileOps: Retrieve file stats with Python utility. Handle size, ownership, timestamps. Ensure accurate file paths
- Host: GitHub
- URL: https://github.com/nivindulakshitha/file-stats
- Owner: nivindulakshitha
- License: cc0-1.0
- Created: 2024-03-23T02:14:41.000Z (about 1 year ago)
- Default Branch: Master
- Last Pushed: 2024-03-25T05:15:06.000Z (about 1 year ago)
- Last Synced: 2025-02-21T13:25:00.235Z (4 months ago)
- Topics: pyhton
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File Operations Utility
This utility provides functionalities to retrieve statistics of a file such as size, ownership, and timestamps.
### Usage:
1. Ensure `fileOps.py` is present in the same directory.
2. Import `fileStat` class from `fileOps` module.
3. Create an instance of `fileStat` by providing the file path.
4. Use `getFileStat()` method to retrieve file statistics.### Example (app.py):
```python
from fileOps import fileStatmyfileStat = fileStat(filepath="sample.txt")
if (myfileStat.fileReady):
print(myfileStat.getFileStat())
```### Classes:
- `__file__`: Handles file operations and readiness state.
- `fileStat`: Inherits from `__file__` and provides file statistics retrieval.### Methods:
- `getFilepath()`: Returns the file path.
- `setFilePath(new_filepath)`: Updates the file path.
- `getFileStat()`: Retrieves file statistics.### Note:
Ensure proper file path and permissions for accurate results.