This script checks the existence of a specified file and determines its MIME type. It's useful for quickly identifying the type of a given file.
- Verifies the existence of a file at a given path.
- Determines the MIME type of the file.
- Special handling for FITS files, interpreting them as "image/fits".
Run the script from the command line by passing the path to the file:
./mimetype.py path/to/your/file
- Python 3
- mimetype-description package (install via
pip install mimetype-description
)
./mimetype.py sample_file.fits
This will output the MIME type of 'sample_file.fits'.
For help, run:
./mimetype.py --help