rpaframework
rpaframework copied to clipboard
RPA.FileSystem.Append To File fails if file does not exists
Consider whether it is more productive to fail the keyword or implicitly create the missing file. In the use cases that I have faced, it would have been easier to just automatically create the file. However, if also the parent directory is missing then I would fail this keyword. Opinions?
No strong opinion here and my common use-cases would be:
A.
Append To File ... ensure=True
-> ensures that
- Parent directories are created (
mkdir -p
) - File is created if it doesn't exist (
touch
)
B.
Append To File ...
-> works as before
This will simplify usual calls like (note steps 1, 2, 3):
File work
${exists} = Does File Exist ${text_file} # 1
Run Keyword Unless ${exists} Create File ${text_file} # 2
${time} = Get Current Date
Append To File ${text_file} Ran at: ${time}${\n} # 3
@mikahanninen Let me know if during our sync it was decided something else.