FIND YOUR NEXT FEW LINES

Results for “File operations & paths”

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

946 snippets foundClear filters
GoFiles & paths

Read from an in-memory filesystem

Read from an in-memory filesystem using a complete Go program with explicit sample inputs.

Go✓ Tested
C++Filesystem operations

Read the byte size of a regular file

C++: file_size reads filesystem metadata without loading file contents.

C++✓ Tested
PythonFile operations & archives

Rename a file within a directory

Python: Use Path.rename and inspect the resulting path.

Python✓ Tested
C++Filesystem operations

Rename a known file through filesystem

C++: filesystem::rename reports an error by exception when the operation fails.

C++✓ Tested
GoFiles & paths

Separate a filename extension

Separate a filename extension using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFiles & paths

Write and read a UTF-8 file

Write and read a UTF-8 file using a complete Go program with explicit sample inputs.

Go✓ Tested
RustFiles & paths

Write and read a UTF-8 file

Write and read a UTF-8 file in a complete Rust program using the standard library.

Rust✓ Tested
RustFiles & paths

Change a path’s extension

Change a path’s extension in a complete Rust program using the standard library.

Rust✓ Tested
PythonFile operations & archives

Clean up a temporary directory automatically

Python: Use TemporaryDirectory as a context manager so cleanup also happens after exceptions.

Python✓ Tested
GoFiles & paths

Copy a stream and count its bytes

Copy a stream and count its bytes using a complete Go program with explicit sample inputs.

Go✓ Tested
RustFiles & paths

Create a nested directory tree

Create a nested directory tree in a complete Rust program using the standard library.

Rust✓ Tested
GoFiles & paths

Create nested directories

Create nested directories using a complete Go program with explicit sample inputs.

Go✓ Tested