Results for “File operations & integrity”
Small, practical examples. Search by task or narrow things down below.
Run a one-off process with a numeric user ID
Docker / Compose: The user option overrides the image’s default identity.
Docker / Compose✓ Tested
Run an image as a non-root user
Choose an unprivileged numeric identity for the default process.
Dockerfile✓ Tested
Select a range of array elements
Bash Scripts: Quote a sliced at-sign expansion to keep each selected element separate.
Bash Scripts✓ Tested
Set a container’s own hostname
Docker / Compose: hostname changes the name reported inside the container.
Docker / Compose✓ Tested
Set a working directory
Choose the default directory for later instructions and the running process.
Dockerfile✓ Tested
Set an image’s default command
Use JSON array syntax for a predictable command.
Dockerfile✓ Tested
Sort only the smallest requested prefix
C++: partial_sort orders the selected prefix without guaranteeing the order of the remainder.
C++✓ Tested
Sort records by two fields
C++: Tuple comparison implements lexicographic ordering across several keys.
C++✓ Tested
Sort timestamp strings by their parsed instants
JavaScript: Compare epoch values explicitly when date strings may contain different offsets.
JavaScript✓ Tested
Sort timestamp strings by their parsed instants
TypeScript: Compare epoch values explicitly when date strings may contain different offsets.
TypeScript✓ Tested
Sum the decimal digits of an unsigned integer
C: Repeated division and remainder extract digits without converting to text.
C✓ Tested
Supply an environment variable to an exec process
Docker / Compose: An exec environment override applies to the new process only.
Docker / Compose✓ Tested