Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Put Directory Keyword with overwrite option #345

Closed
jlz3008 opened this issue Apr 12, 2020 · 2 comments
Closed

Enhance Put Directory Keyword with overwrite option #345

jlz3008 opened this issue Apr 12, 2020 · 2 comments

Comments

@jlz3008
Copy link

jlz3008 commented Apr 12, 2020

The problem
It is usual repeat a test that involved a download directory from host to the target.
If a file have already been downloaded it is not necessary download it again. This is particulary annoying if the file is big or the directory contain a large number of files.

Actually Put Directory Keyword overwrite the files once and again.

It would be great if the Put Directory Keyword had a overwrite=true option.

If overwrite were false, Put Directory Keyword would not download the files if they exists.

@cristii006
Copy link
Contributor

Hi @jlz3008,

You can use the keyword Directory Should Exist in order to check that a directory is present or not on the remote machine. If you want to check if a directory is present on local machine you can use Directory Should Exist from the Operating System library.

You can do something like this if you want to check if a directory is present and if not put it to remote machine:

${status}=  Run Keyword And Return Status  Directory Should Exist  path_to_directory
Run Keyword If  ${status}==False  Put Directory  directory_to_put

Best regards,
Andrei-Cristian

@rticau
Copy link
Contributor

rticau commented Feb 24, 2021

The solution proposed by @cristii006 is pretty simple and straightforward and I don't see a significant benefit that can justify the effort to add the additional option to the keyword. Closing the issue now but if you @jlz3008 have further comments please let us know, we are happy to continue the discussion.

@rticau rticau closed this as completed Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants