-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
File ModuleRelated to the "File" module inside FileSystemProRelated to the "File" module inside FileSystemProenhancementNew feature or requestNew feature or request
Description
The reassemble_file() function currently uses the fixed .fsp extension when searching for split file parts.
To improve flexibility and allow developers to define their own part extensions, a new parameter should be added to the function.
Current Behavior
while os.path.exists(f'{large_file}.fsp{str(i)}'):
parts.append(f'{large_file}.fsp{str(i)}')The .fsp extension is hardcoded, which limits the ability to use other naming schemes.
Expected Behavior
Add an optional extension parameter to the function:
def reassemble_file(large_file, new_file, extension=".fsp"):This parameter allows custom extensions to be specified, e.g.:
reassemble_file("large_file", "new_file", extension=".part")Acceptance Criteria
- Add
extensionparameter toreassemble_file()with a default value of.fsp. - Replace hardcoded
.fspusage with the new parameter. - Update the function docstring to document the new parameter.
- Keep backward compatibility with existing code.
- Add examples showing usage with custom extensions.
Example
# Default behavior
reassemble_file("archive", "archive_restored")
# Custom extension
reassemble_file("archive", "archive_restored", extension=".chunk")Additional Context
This change improves flexibility for users who rely on different file-naming conventions during the split/reassemble process.
Metadata
Metadata
Assignees
Labels
File ModuleRelated to the "File" module inside FileSystemProRelated to the "File" module inside FileSystemProenhancementNew feature or requestNew feature or request