FIND YOUR NEXT FEW LINES

Results for “File operations & archives”

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

947 snippets foundClear filters
C++Filesystem operations

Handle a failed file open through stream state

C++: An unopened input stream is not an empty successful file read.

C++✓ Tested
C#File operations & paths

Inspect a file length without reading it

C#: Use FileInfo.Length to retrieve a logical size in bytes.

C#✓ Tested
C++Filesystem operations

List regular files recursively in sorted order

C++: Collect relative paths before sorting because directory iteration order is unspecified.

C++✓ Tested
PowerShellFile operations & integrity

Move a file into another directory

PowerShell: Move-Item transfers an existing file to the chosen destination directory.

PowerShell✓ Tested
C#File operations & paths

Move a file to a new filename

C#: File.Move changes the file path without loading its contents.

C#✓ Tested
JavaFile operations & binary data

Move a file to a new name

Java: Files.move changes the path and returns the destination Path.

Java✓ Tested
C++Filesystem operations

Normalize a path without touching the filesystem

C++: lexically_normal removes redundant dot components using path syntax alone.

C++✓ 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
PowerShellFile operations & integrity

Read a file size in bytes

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

PowerShell✓ Tested