Results for “Archive integrity & packaging”
Small, practical examples. Search by task or narrow things down below.
Export committed files without the Git metadata directory
Git: Git archive creates a snapshot of tracked committed files only.
Git✓ Tested
Extract filename components
Python: Use pathlib properties to separate a directory, filename stem, and suffix.
Python✓ Tested
Find matching files recursively
Python: Use rglob and sorted relative paths for a reproducible recursive file listing.
Python✓ Tested
Find matching files recursively
PowerShell: Select files explicitly and sort their names for predictable presentation.
PowerShell✓ Tested
Hash a file without reading it all at once
Python: Feed fixed-size binary chunks into SHA-256 for files larger than memory.
Python✓ Tested
Move a file into another directory
PowerShell: Move-Item transfers an existing file to the chosen destination directory.
PowerShell✓ Tested
Read a file lazily through the .NET line iterator
PowerShell: ReadLines avoids creating one string containing the entire file.
PowerShell✓ Tested
Read a file size in bytes
Python: Use stat().st_size to read the logical byte length without loading the file.
Python✓ Tested
Read a file size in bytes
PowerShell: The Length property of a file item reports its logical byte size.
PowerShell✓ Tested
Read compressed text directly
Python: Open gzip data in text mode with an explicit encoding.
Python✓ Tested
Rename a file in its current directory
PowerShell: Rename-Item changes the name without moving the item to another directory.
PowerShell✓ Tested
Rename a file within a directory
Python: Use Path.rename and inspect the resulting path.
Python✓ Tested