Results for “os”
Small, practical examples. Search by task or narrow things down below.
Refuse to overwrite an existing file with redirection
Bash Scripts: Noclobber makes a plain greater-than redirection fail when the target already exists.
Bash Scripts✓ Tested
Reject a missing required configuration value
Bash Scripts: Check a required value explicitly and emit a controlled diagnostic before exiting.
Bash Scripts✓ Tested
Reject a negative quantity with CHECK
SQL: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.
SQL✓ Tested
Reject a negative quantity with CHECK
SQL Server: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.
SQL Server✓ Tested
Reject a negative quantity with CHECK
Postgres: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.
Postgres✓ Tested
Reject a negative quantity with CHECK
SQLite: Combine NOT NULL and CHECK because an unknown NULL check result is normally accepted.
SQLite✓ Tested
Reject duplicate business identifiers
Postgres: A UNIQUE constraint protects a business key independently of the primary key.
Postgres✓ Tested
Remove dependent rows with a declared cascade
Postgres: ON DELETE CASCADE removes children when their referenced parent is deleted.
Postgres✓ Tested
Remove duplicate result values
Postgres: Use DISTINCT when repeated category values are not useful.
Postgres✓ Tested
Remove duplicate values while keeping the smallest key
Postgres: Identify retained keys in a grouped subquery before deleting other copies.
Postgres✓ Tested
Remove one known scratch file
C: Check remove’s return value instead of assuming deletion succeeded.
C✓ Tested
Remove one network attachment
Docker / Compose: network disconnect removes the specified attachment while retaining the container.
Docker / Compose✓ Tested