FIND YOUR NEXT FEW LINES

Results for “Filesystem operations”

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

184 snippets foundClear filters
JavaQueues & collection operations

Preserve map insertion order

Java: Use LinkedHashMap when iteration should follow the order keys were first added.

Java✓ Tested
C#File operations & paths

Process a file as a lazy line sequence

C#: ReadLines avoids allocating one string containing the entire file.

C#✓ Tested
JavaFile operations & binary data

Process a text file one line at a time

Java: Use a buffered reader to avoid loading a large file into memory.

Java✓ Tested
PowerShellFile operations & integrity

Read a file lazily through the .NET line iterator

PowerShell: ReadLines avoids creating one string containing the entire file.

PowerShell✓ Tested
JavaFile operations & binary data

Read a file length in bytes

Java: Files.size inspects metadata without loading the file into a Java string.

Java✓ Tested
PythonFile operations & archives

Read a file size in bytes

Python: Use stat().st_size to read the logical byte length without loading the file.

Python✓ Tested
PowerShellFile operations & integrity

Read a file size in bytes

PowerShell: The Length property of a file item reports its logical byte size.

PowerShell✓ Tested
C#File operations & paths

Read a filename stem and extension

C#: Use Path helpers instead of splitting a path on dots or directory separators.

C#✓ Tested
JavaScriptUTC date operations

Read an ISO-style weekday number

JavaScript: Convert Sunday from zero to seven when using Monday-through-Sunday numbering.

JavaScript✓ Tested
TypeScriptUTC date operations

Read an ISO-style weekday number

TypeScript: Convert Sunday from zero to seven when using Monday-through-Sunday numbering.

TypeScript✓ Tested
Bash ScriptsArray operations

Read an optional associative-array entry

Bash Scripts: Use a fallback expansion when a map key may not be present under nounset.

Bash Scripts✓ Tested
PythonFile operations & archives

Read compressed text directly

Python: Open gzip data in text mode with an explicit encoding.

Python✓ Tested