FIND YOUR NEXT FEW LINES
Results for “current path”
Small, practical examples. Search by task or narrow things down below.
284 snippets foundClear filters
Visit files recursively
Java: Close the stream returned by Files.walk and sort relative paths for stable output.
Java✓ Tested
Write a multiline string without expanding variables
PowerShell: A single-quoted here-string preserves dollar signs literally.
PowerShell✓ Tested
Write a text file
Save a string to a UTF-8 text file and close the file automatically when the write finishes.
file✓ Tested
Write a text file
Write a C# string to a UTF-8 file.
C#✓ Tested
Write a text file
Write and close a C++ output file while checking stream failure.
C++✓ Tested
Write a UTF-8 file
Write a Java string to a file using an explicit text encoding.
Java✓ Tested
Write object records to a CSV file
PowerShell: Export-Csv uses property names as headers and quotes values when needed.
PowerShell✓ Tested
Write UTF-8 text to a file
Save a string without adding an extra newline.
Set-Content✓ Tested