FIND YOUR NEXT FEW LINES

Results for “Files & paths”

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

495 snippets foundClear filters
PowerShellDates & numeric validation

Compute beyond the fixed-width integer range

PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.

PowerShell✓ Tested
Docker / ComposeLimits & process security

Configure bounded retries after a failure

Docker / Compose: on-failure with a count limits automatic restart attempts.

Docker / Compose✓ Tested
PowerShellHashtables & object records

Construct a record with named properties

PowerShell: PSCustomObject gives downstream pipeline commands meaningful property names.

PowerShell✓ Tested
PowerShellHashtables & object records

Convert an object’s properties into a hashtable

PowerShell: Enumerate PSObject.Properties when the set of property names is known only at runtime.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Convert between hexadecimal text and bytes

PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.

PowerShell✓ Tested
PowerShellDates & numeric validation

Convert Unix seconds into an aware UTC timestamp

PowerShell: DateTimeOffset.FromUnixTimeSeconds creates a value with an explicit UTC offset.

PowerShell✓ Tested
Docker / ComposeDockerfile patterns

Copy a directory’s contents into an image

Docker / Compose: A directory COPY includes its children at the destination.

Docker / Compose✓ Tested
Docker / ComposeExecution & file transfer

Copy a file into a created container

Docker / Compose: docker cp can copy into a container before its process starts.

Docker / Compose✓ Tested
Docker / ComposeBuild images

Copy a file into an image

Include a small application file during the build.

Dockerfile✓ Tested
PowerShellFile operations & integrity

Copy a file to a chosen destination

PowerShell: LiteralPath prevents wildcard characters in the source filename from being interpreted.

PowerShell✓ Tested
Linux CommandsFiles & folders

Copy a file to a folder

Create a backup folder if needed, then copy a file into it while preserving its modification time and permission bits.

file✓ Tested
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