⛓️💥 filefrag
Python library to get FIE and command line tool
📦 Install
See the video for a demo including installing from source, but you can install with pip:
pip install filefrag
▶️ Usage
Run pyfilefrag on the command line. See --help for details. It has
--verbose, and --json outputs for your parsing pleasure.
To use the library, just call filefrag.FileMap('/path/whatever') to build a map
of the extents in the file using ioctl’s interface. Then you can poke about in
the guts of a file:
- ⛓️💥 inspect fragmentation
- 🔍 find out where data is on your physical drive
- 🟰 compare extents between paths
- 📔 use them as dict keys
- 🕳️ check files for holes, like before and after hole punching
- ✅ verify your deduplication strategy, write your own stats tool
- 💩 dump file layouts to json (
print(f"{filemap:j}")) - ⚠️ break your disk because you believed the outputs of this alpha release!
Comes with a Device class to do comparisons, so it ought to work with fragments in files on different mountpoints, bind mounts and so on (unfortunately not snap’s FUSE mounts; they’re far too abstract and piped in via a socket)
🎓 Example
from filefrag import FileMap
mapping = FileMap('/usr/bin/bash')
print(mapping.extents)
⚖️ License
Licensed under the WTFPL with one additional clause:
- Don't blame me.
Do whatever the fuck you want, just don't blame me.
🤝 Contributing
Not that this thing will ever be big enough to need a code of conduct, but it's a good excuse to pimp out my common fucking sense code of conduct.
🔗 Links
Release files for filefrag 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| filefrag-0.1.0.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| filefrag-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / filefrag-0.1.0.tar.gz
| Download URL | filefrag-0.1.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cd6879358576d2ae6541c531cdcc0af6aeee96a71ef1ab20d5ea6444f5fcc3d
|
|
BLAKE2b-256 checksum How to use checksums |
af2186a9d8b0aedbc30f9ceb6bfe47e89f80bcc8202c327a277b52444ca3339d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|
Release files / filefrag-0.1.0-py3-none-any.whl
| Download URL | filefrag-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3fad5906b002a43fc63d439fe4cd2f6664caaa907e0dc2fa6844c6fe160362ae
|
|
BLAKE2b-256 checksum How to use checksums |
fb36231d4bfc77f180509fff8d298571a8441b9c59e996ad6d8b6a564665ef12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.21
|