Salmon
Loading...
Searching...
No Matches
salmon_fs.salmon.utils.salmon_file_importer Namespace Reference

Classes

class  SalmonFileImporter
 

Functions

 import_file (int index, int final_part_size, int final_running_threads, int file_size, IRealFile file_to_import, IRealFile salmon_real_file, str shm_total_bytes_read_name, str shm_cancel_name, int buffer_size, bytearray key, bool integrity, bytearray|None hash_key, int|None chunk_size)
 
 import_file_part (IRealFile file_to_import, SalmonFile salmon_file, int start, int count, memoryview|None total_bytes_read, int buffer_size, str|None shm_cancel_name=None, list[bool]|None stopped=None, Callable[[int, int], Any]|None on_progress=None)
 

Detailed Description

MIT License

Copyright (c) 2021 Max Kas

Permission is hereby granted, free of charge, to any person obtaining a copy
of self software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and self permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Function Documentation

◆ import_file()

import_file ( int index,
int final_part_size,
int final_running_threads,
int file_size,
IRealFile file_to_import,
IRealFile salmon_real_file,
str shm_total_bytes_read_name,
str shm_cancel_name,
int buffer_size,
bytearray key,
bool integrity,
bytearray | None hash_key,
int | None chunk_size )

◆ import_file_part()

import_file_part ( IRealFile file_to_import,
SalmonFile salmon_file,
int start,
int count,
memoryview | None total_bytes_read,
int buffer_size,
str | None shm_cancel_name = None,
list[bool] | None stopped = None,
Callable[[int, int], Any] | None on_progress = None )
Import a file part into a file in the drive.

:param file_to_import:   The external file that will be imported
:param salmon_file:     The file that will be imported to
:param start:          The start position of the byte data that will be imported
:param count:          The length of the file content that will be imported
:param total_bytes_read: The total bytes read from the external file
:param buffer_size: The buffer size
:param shm_cancel_name: The shared memory for cancelation
:param stopped: The stopped flag
:param on_progress:      Progress observer