Results for “Files & paths”
Small, practical examples. Search by task or narrow things down below.
Calculate a lexical relative path
C++: lexically_relative compares path components without requiring the paths to exist.
C++✓ Tested
Inspect changes to a container’s writable layer
Docker / Compose: diff marks added, changed, and deleted filesystem paths.
Docker / Compose✓ Tested
Append a line
Append UTF-8 text without replacing existing C# file contents.
C#✓ Tested
Append a line
Append text to a Java file, creating it if necessary.
Java✓ Tested
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
Append text to a file
Open a C++ stream in append mode and verify the write.
C++✓ Tested
Create a directory if needed
Ensure a directory exists before writing output.
New-Item✓ Tested
Create nested directories
Create a directory tree using the .NET Directory API.
C#✓ Tested
Create nested directories
Create missing parent directories with Java Files.createDirectories.
Java✓ Tested
Create nested directories
Use C++17 filesystem to create a directory tree.
C++✓ Tested
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
Declare LF normalization for a file type
Git: A gitattributes rule records text normalization expectations for matching paths.
Git✓ Tested