rshell - Remote Shell

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
bukaida
Posts: 19
Joined: Tue Jul 07, 2020 6:30 pm

Re: rshell - Remote Shell

Post by bukaida » Sun Jul 19, 2020 7:47 pm

How can I rename remote files/directories using rshell? Is it possible to accommodate any tiny micropython editor within rshell itself, so that external editor is not required?
Also during

Code: Select all

cp -r
it will be helpful if the file name being currently copied, is displayed.

User avatar
pythoncoder
Posts: 4485
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: rshell - Remote Shell

Post by pythoncoder » Mon Jul 20, 2020 7:34 am

Have you studied the rsync command? I appreciate it doesn't do exactly what you want, but it does provide feedback on files copied and will replicate directory structures. It will also cope with directories renamed on the source (using the -m option).

Use with care: it is a powerful tool and can wreak havoc if used incorrectly...
Peter Hinch

bukaida
Posts: 19
Joined: Tue Jul 07, 2020 6:30 pm

Re: rshell - Remote Shell

Post by bukaida » Mon Jul 20, 2020 8:11 am

Yes Peter, I have tried it, but that is a passive way and sometimes does not produce good results for long names with special characters ( In windows). I was just thinking if we can have something direct as mkdir, rm or cp. For example

Code: Select all

ren old_name new_name
may be in the next update ?

User avatar
Roberthh
Posts: 2147
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: rshell - Remote Shell

Post by Roberthh » Mon Jul 20, 2020 8:26 am

You can always rename file on the windows side with windows tools, and on the micropython side with uos.rename() in the REPL prompt. That may not be comfortable, but it works. if you have a device connected by ftp, you can use the ftp mechanisms.

User avatar
pythoncoder
Posts: 4485
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: rshell - Remote Shell

Post by pythoncoder » Mon Jul 20, 2020 8:44 am

There is also my fork of rshell. This enables the use of text macros. The docs show how to create an mv macro which moves/renames files by copying and deleting. I guess one could be written to do the same trick for directories using cp -r and rm -r. Like rsync it would have potential for havoc if used incorrectly.
Peter Hinch

Post Reply