FIND YOUR NEXT FEW LINES

Results for “read only”

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

990 snippets foundClear filters
JavaFile operations & binary data

Copy a file without replacing an existing destination

Java: Files.copy fails if the destination already exists unless replacement is explicitly enabled.

Java✓ Tested
C++Filesystem operations

Copy a file without replacing an existing destination

C++: The default copy_file policy refuses to overwrite an existing destination.

C++✓ Tested
Arduino / CEEPROM & program memory

Copy a flash string into a bounded RAM buffer

Arduino / C: strncpy_P reads from program memory into ordinary RAM.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Copy a multibyte interrupt-owned counter atomically

Arduino / C: ATOMIC_RESTORESTATE restores the interrupt state after reading a shared value.

Arduino / C✓ Tested
GoSlices & collections

Copy a slice without sharing storage

Copy a slice without sharing storage using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFiles & paths

Copy a stream and count its bytes

Copy a stream and count its bytes using a complete Go program with explicit sample inputs.

Go✓ Tested
GoMaps & sets

Copy entries into another map

Copy entries into another map using a complete Go program with explicit sample inputs.

Go✓ Tested
GitRestoring & revising local work

Correct the latest unpublished commit message

Git: Amend replaces the current commit while preserving its tree when no new changes are staged.

Git✓ Tested
Arduino / CDigital signals & interrupts

Count a button’s falling edge in the main loop

Arduino / C: Compare each reading with the previous state to detect transitions.

Arduino / C✓ Tested
Arduino / CDigital input & output

Count a falling edge with an interrupt

Increment a counter when an external input changes.

attachInterrupt✓ Tested
GitCommit history & revision selection

Count commits reachable from a revision

Git: rev-list --count counts reachable commits without printing commit identifiers.

Git✓ Tested
GitBranches & ancestry

Count commits unique to each of two branches

Git: The symmetric difference with left-right separates commits reachable from only one side.

Git✓ Tested