In the online tutorials, it is clear how to copy a file from the C drive to a Pyboard when using rshell:
cp main.py /pyboard/main.py
However, how do you go the opposite direction and copy a file from a Pyboard to the C drive? I have tried the following syntax but have been receiving the following error:
cp main.py /C:/Users/<username>/Documents/main.py
OSERror: [Errno 22] Invalid argument : '/C:/Users/<username>/Documents/main.py'
Copying from Pyboard to C drive with rshell
Re: Copying from Pyboard to C drive with rshell
maybe:
cp /pyboard/main.py main.py
cp /pyboard/main.py main.py
Re: Copying from Pyboard to C drive with rshell
Under windows, / will be the root of the current drive.
So you have 2 options. When you launch rshell, the current directory will be the directory that you were in when you launched. You could then use: or if you had already changed the current directory to say /pyboard:
I don't think that rshell deals well with spaces in the filenames or directory names.
So you have 2 options. When you launch rshell, the current directory will be the directory that you were in when you launched. You could then use:
Code: Select all
cp /pyboard/main.py main.py
Code: Select all
cd /pyboard
cp main.py /Users/<username>/Documents/main.py
Re: Copying from Pyboard to C drive with rshell
Thanks, Dave. Your second option worked just fine. I think the issue was including the /C: prefix for the destination file location.dhylands wrote: ↑Thu Jan 06, 2022 5:55 pmUnder windows, / will be the root of the current drive.
So you have 2 options. When you launch rshell, the current directory will be the directory that you were in when you launched. You could then use:or if you had already changed the current directory to say /pyboard:Code: Select all
cp /pyboard/main.py main.py
I don't think that rshell deals well with spaces in the filenames or directory names.Code: Select all
cd /pyboard cp main.py /Users/<username>/Documents/main.py