FIND YOUR NEXT FEW LINES

Results for “Streams & byte tools”

Small, practical examples. Search by task or narrow things down below.

147 snippets foundClear filters
Linux CommandsArchives & checksums

Compress a file and keep the original

Create a gzip-compressed copy of a file while leaving the uncompressed original in place.

gzip✓ Tested
CSmall algorithms & bit operations

Compute a simple XOR checksum

C: XOR all payload bytes into one byte to demonstrate a basic error-detection field.

C✓ Tested
C++Text validation & parsing

Convert ASCII text to lowercase safely

C++: Cast each byte to unsigned char before using the cctype function.

C++✓ Tested
Linux CommandsFiles & folders

Copy a file to a folder

Create a backup folder if needed, then copy a file into it while preserving its modification time and permission bits.

file✓ Tested
Linux CommandsText processing

Count lines in a file

Count newline characters in a text file, printing only the count without the filename.

lines✓ Tested
CFiles

Count newline characters

Count newline bytes in a C file while retaining EOF as an int.

C✓ Tested
Linux CommandsArchives & checksums

Create a compressed tar archive

Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.

tar✓ Tested
Linux CommandsFiles & folders

Create a directory tree

Create a directory and its missing parent directories. The -p option also succeeds when the directories already exist.

directory✓ Tested
Linux CommandsFiles & folders

Create a symbolic link

Create a relative symbolic link to a file and inspect its target with readlink.

symlink✓ Tested
CBinary formats & structured parsing

Decode a 16-bit big-endian integer

C: Promote bytes to an unsigned integer type before combining shifted values.

C✓ Tested
PythonText validation & encoding

Encode and decode binary data as Base64

Python: Use Base64 when a text format must carry bytes; it is encoding, not encryption.

Python✓ Tested
PowerShellStructured formats & encodings

Encode and decode UTF-8 text with Base64

PowerShell: Convert the string to bytes explicitly before Base64 encoding.

PowerShell✓ Tested