FIND YOUR NEXT FEW LINES

Results for “Files & paths”

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

495 snippets foundClear filters
C++Files & paths

Write a text file

Write and close a C++ output file while checking stream failure.

C++✓ Tested
JavaFiles & paths

Write a UTF-8 file

Write a Java string to a file using an explicit text encoding.

Java✓ Tested
PowerShellFiles & paths

Write UTF-8 text to a file

Save a string without adding an extra newline.

Set-Content✓ Tested
Linux CommandsGetting Started

Check whether two practice files match

Linux Commands: Check whether two practice files match using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
Docker / ComposeLimits & process security

Confirm the root filesystem rejects writes

Docker / Compose: A read-only root prevents creating files outside writable mounts.

Docker / Compose✓ Tested
Linux CommandsFiles & permissions

Create private files with a restrictive umask

Linux Commands: Apply umask in a subshell so the surrounding shell is unaffected.

Linux Commands✓ Tested
Docker / ComposeDockerfile patterns

Exclude files from the build context

Docker / Compose: A dockerignore file prevents selected local files from being copied.

Docker / Compose✓ Tested
Docker / ComposeImage management

Export a container filesystem into a new image

Docker / Compose: export contains filesystem data; import creates a new image from it.

Docker / Compose✓ Tested
GitTags & repository configuration

Export committed files without the Git metadata directory

Git: Git archive creates a snapshot of tracked committed files only.

Git✓ Tested
Linux CommandsFinding & selecting files

Find empty regular files

Linux Commands: Use the empty predicate with a file type constraint.

Linux Commands✓ Tested
Linux CommandsFinding & selecting files

Find files larger than a byte threshold

Linux Commands: Use the c suffix for exact byte units with GNU find size tests.

Linux Commands✓ Tested
Linux CommandsSorting & joining records

Find lines common to two sorted files

Linux Commands: Use comm -12 to suppress the two columns of unmatched lines.

Linux Commands✓ Tested