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++Filesystem operations

Calculate a lexical relative path

C++: lexically_relative compares path components without requiring the paths to exist.

C++✓ Tested
Docker / ComposeExecution & file transfer

Inspect changes to a container’s writable layer

Docker / Compose: diff marks added, changed, and deleted filesystem paths.

Docker / Compose✓ Tested
C#Files & paths

Append a line

Append UTF-8 text without replacing existing C# file contents.

C#✓ Tested
JavaFiles & paths

Append a line

Append text to a Java file, creating it if necessary.

Java✓ Tested
PythonFiles & paths

Append a line to a file

Add a new line to the end of a text file without replacing its existing contents. Append mode also creates the file if it does not exist.

file✓ Tested
C++Files & paths

Append text to a file

Open a C++ stream in append mode and verify the write.

C++✓ Tested
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested
C#Files & paths

Create nested directories

Create a directory tree using the .NET Directory API.

C#✓ Tested
JavaFiles & paths

Create nested directories

Create missing parent directories with Java Files.createDirectories.

Java✓ Tested
C++Files & paths

Create nested directories

Use C++17 filesystem to create a directory tree.

C++✓ Tested
PythonFiles & paths

Create nested folders

Create a folder and any missing parent folders in one call. Running the code again is safe when the folder already exists.

directory✓ Tested
GitTags & repository configuration

Declare LF normalization for a file type

Git: A gitattributes rule records text normalization expectations for matching paths.

Git✓ Tested