Open greschd opened 6 months ago
@greschd
Is it possible to add delete_file()
method that will delete file on the remote.
So that we can use following logic.
fts = RemoteFileTransferStrategy()
if fts.file_exists(file_name):
fts.delete_file(file_name)
fts.upload_file(file_name, remote_file_name)
While I see the use of both file_exists
and delete_file
, it's also worth pointing out that
fts.delete_file(file_name)
fts.upload_file(file_name, remote_file_name)
is equivalent to just
fts.upload_file(file_name, remote_file_name)
In the case we looked at (source and remote file being accidentally the same via a bind-mount), the delete_file
would also delete the source file, causing upload_file
to fail.
Yes, right. I agree.
📝 Description of the feature
Add a method to check for existence of a file on the remote. Requested by @hpohekar / PyFluent.
💡 Steps for implementing the feature
🔗 Useful links and references
No response