Results for “file check”
Small, practical examples. Search by task or narrow things down below.
Check whether text starts with a prefix
TypeScript: Use startsWith for a literal case-sensitive prefix comparison.
TypeScript✓ Tested
Choose a local file through a labeled control
HTML: A file input exposes selected file metadata to the page without providing arbitrary filesystem access.
HTML✓ Tested
Classify a filename with shell patterns
Bash Scripts: Case patterns support alternatives without launching an external regex tool.
Bash Scripts✓ Tested
Collect several checked values under one name
HTML: Only checked named checkboxes become successful form controls.
HTML✓ Tested
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
Compute a simple XOR checksum
C: XOR all payload bytes into one byte to demonstrate a basic error-detection field.
C✓ Tested
Confirm the root filesystem rejects writes
Docker / Compose: A read-only root prevents creating files outside writable mounts.
Docker / Compose✓ Tested
Control a checkbox
Control a checkbox with a small React component and explicit browser behavior.
React✓ Tested
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
Copy a file and preserve its metadata
Python: Use copy2 for a file copy that also attempts to preserve timestamps and permission bits.
Python✓ Tested
Copy a file into a created container
Docker / Compose: docker cp can copy into a container before its process starts.
Docker / Compose✓ Tested
Copy a file into an image
Include a small application file during the build.
Dockerfile✓ Tested