IPWorks SFTP 2020 Python Edition

Questions / Feedback?

queue_file Method

Adds a file to the transfer queue.

Syntax

def queue_file(local_file: str, remote_file: str) -> None: ...

Remarks

This method adds a file to the queue of files that will be transferred.

It is not required to use this method, however this extends the ability of the class to allow for multiple simultaneous file transfers.

To simply transfer a file without using this method you need only set local_file, remote_file, and call upload or download as appropriate. This method allows you to instead queue multiple files before beginning a transfer.

When a file is queued it will not be transferred until the upload or download method is called. If multiple files are queued the files will be transferred simultaneously. The SimultaneousTransferLimit setting controls the maximum number of simultaneous transfers.

The upload or download method will not return until the Queue has been completely processed. This method may be called from within events in order to add additional files to the Queue before processing is complete.

To clear the queue call reset_queue. This will not affect current transfers.

To cancel and individual file transfer set the Cancel parameter of the on_transfer event to true. The rest of the queue will continue to process as normal.

The interrupt method may be called to immediately stop all current transfers.

In the event of a file specific error the on_error event will fire and the LocalFile and RemoteFile event parameters can be used to identify the file to which the error applies.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks SFTP 2020 Python Edition - Version 20.0 [Build 8263]