Hi, I’m struggling with an error that should be simple but I can’t see where it is failing. I want to get the list of files in a folder, in Linux (Ubuntu 20) all was simple, I used
Run And Return Rc And Output cd ./somefolder/anotherfolder/'Alexander Magno'/lastfolder && ls *.pdf and it return the list of pdf in that folder. BTW, the keyword running this was in
root/keywords, therefore, I used the
. to return to the root of the bot and then go to
The problem is in Windows. When I tried the same it return rc=1 and output was empty. I decided to make the test in cmd, so I run the same code and it returned an error that said that it did not find the folder. I change from simple quotes (
'' ) to double quotes (
"" ) and it worked. I also tried without quotes and worked, it returned the list of pdf inside
lastfolder . Then I go to the robot and run it, but the same error appears even if I use double quotes or none. Off course I changed
dir (because of Windows), so my keyword was:
Run And Return Rc And Output cd ../somefolder/anotherfolder/"Alexander Magno"/lastfolder && dir /B *.pdf . In Windows cmd to return to the previous folder is with
.. instead of the
. from Linux.
I removed the
&& dir /B *.pdf part and now output is not empty, it says that it can’t find that path. The same error appears if I removed the quotes. Then I wrote
& dir /B *.pdf and output showed: The modifier “*.pdf” is not valid.
Hope someone can help me, thanks.
Edit: it might have to do with Robocorp in Windows, because sometimes it uses a Temp folder instead of where I’m truly am, I will check this now