Skip to main content

Module fs

Module fs 

Source
Expand description

File system operations for Humanize.

This module provides safe file operations with path validation to prevent security issues like path traversal and symlink attacks.

Structs§

PathValidationOptions
Options for path validation.

Enums§

FsError
Errors that can occur during file operations.
RoundFileType
Round file types that have special handling in validators.

Functions§

extract_round_number
Extract round number from a round filename.
is_allowlisted_file
Check if a file path is allowlisted for reading during a loop.
is_any_round_file
Check if a path is any round file (summary, prompt, or todos).
is_in_humanize_loop_dir
Check if a path is inside .humanize/rlcr/ or .humanize/pr-loop/.
is_protected_state_file
Check if a path is a protected state file that should be blocked from writing.
is_round_file_type
Check if a path is a specific round file type.
is_round_specific_file
Check if a path is a round-specific file that should be blocked from reading.
validate_json_depth
Validate JSON depth to prevent DoS attacks.
validate_path
Validate a path for security.