Helpers
provide.foundation.file.operations.detectors.helpers
¶
Shared helper functions for file operation detectors.
Functions¶
extract_base_name
¶
Extract base filename for grouping related files.
Removes temp/backup suffixes and prefixes to find the original filename. Returns None if no temp/backup pattern is found.
Source code in provide/foundation/file/operations/detectors/helpers.py
find_real_file_from_events
¶
Find the real (non-temp) file path from a list of events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
events
|
list
|
List of FileEvent objects |
required |
Returns:
| Type | Description |
|---|---|
Path | None
|
Real file path if found, None otherwise |
Source code in provide/foundation/file/operations/detectors/helpers.py
is_backup_file
¶
Check if path looks like a backup file.
Source code in provide/foundation/file/operations/detectors/helpers.py
is_temp_file
¶
Check if path looks like a temporary file.
Detects temp files from various sources: - Editors: VSCode, Vim, Emacs, Sublime, etc. - Build tools: Python tempfile, system tmp, etc. - Atomic write patterns: .tmp.{PID}.{timestamp}