FIND YOUR NEXT FEW LINES

Results for “file check”

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

1328 snippets foundClear filters
Bash ScriptsDiagnostics & defensive scripting

Check for an installed command

Bash Scripts: command -v checks command resolution without assuming a specific installation path.

Bash Scripts✓ Tested
PostgresJSON & arrays

Check JSONB containment

Test whether an object contains a key-value pair.

jsonb✓ Tested
Linux CommandsSystem information

Check memory usage

Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.

memory✓ Tested
jQueryForm serialization & state

Check native form validity before proceeding

jQuery: Use the native checkValidity API from the selected form.

jQuery✓ Tested
CNumeric parsing & arithmetic

Check positive integer addition before performing it

C: Check the upper boundary before adding two known nonnegative integers.

C✓ Tested
JavaDates & time zones

Check the Gregorian leap-year rule

Java: Use Year.isLeap rather than checking divisibility by four alone.

Java✓ Tested
Linux CommandsSystem information

Check the size of a folder

Show a single total for the disk space used by a folder and its contents.

disk usage✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check whether a function has been defined

Bash Scripts: declare -F tests a function name without executing it.

Bash Scripts✓ Tested
C++Tasks & synchronization

Check whether a future is ready without blocking

C++: A zero-duration wait reports timeout until the producer sets a value.

C++✓ Tested
C++Ordering & set operations

Check whether a range is already sorted

C++: is_sorted reports ordering without modifying the input.

C++✓ Tested
JavaScriptNumbers & numeric validation

Check whether a value is a safe integer

JavaScript: Number.isSafeInteger also checks the exact-integer range supported by Number.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Check whether a value is a safe integer

TypeScript: Number.isSafeInteger also checks the exact-integer range supported by Number.

TypeScript✓ Tested