FIND YOUR NEXT FEW LINES

Results for “File operations & binary data”

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

1473 snippets foundClear filters
Linux CommandsSorting & joining records

Check whether a file is already sorted

Linux Commands: Use sort -C for a quiet status check that does not rewrite the file.

Linux Commands✓ Tested
Linux CommandsGetting Started

Check whether two practice files match

Linux Commands: Check whether two practice files match using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Bash ScriptsArguments & decisions

Classify a filename with shell patterns

Bash Scripts: Case patterns support alternatives without launching an external regex tool.

Bash Scripts✓ Tested
CStrings & byte buffers

Compare binary buffers including zero bytes

C: memcmp checks an explicit byte length rather than stopping at a string terminator.

C✓ Tested
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
Linux CommandsArchive integrity & packaging

Compress a stream to a chosen filename

Linux Commands: Use gzip -c to leave the source file untouched and choose the destination explicitly.

Linux Commands✓ Tested
Docker / ComposeLimits & process security

Confirm the root filesystem rejects writes

Docker / Compose: A read-only root prevents creating files outside writable mounts.

Docker / Compose✓ Tested
RustFiles & paths

Copy a file and inspect the copied byte count

Copy a file and inspect the copied byte count in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeExecution & file transfer

Copy a file into a created container

Docker / Compose: docker cp can copy into a container before its process starts.

Docker / Compose✓ Tested
Docker / ComposeBuild images

Copy a file into an image

Include a small application file during the build.

Dockerfile✓ 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 CommandsDates & process utilities

Copy a file with explicit permissions

Linux Commands: Use install to create parent directories and set the destination mode in one operation.

Linux Commands✓ Tested