Skip to content

Recursive copy / Recursive delete (work in progress) #63

@zindy

Description

@zindy

Hi all,

my uPyLoader fork can now copy folder trees to the MCU and also delete non-empty folders on the MCU side (using code provided by @JustusW over here, thanks mate!

Unfortunately, when copying large folder trees, something isn't quite right and the process can abort with errors. The MCU replies with the last base64 converted string rather than #0...#⁠4, which may suggest feeding lines to the MCU faster than it can process them. This is a bit annoying, because the only thing I can pinpoint to is "it was working before", when I was using my mangled __upload.py as per @BetaRavener's (using connection.run_file() with __upload.py) and it fails now when transferring the same folder but using my new __upl module:

            self.send_start_paste()
            self.send_line("import __upl; __upl.upload(\"{}\")".format(file_name))
            self.send_end_paste()

This is a new module I'm working on, which has upload,download,remove methods all under the same roof. If I can't figure it out, I'll come and ask for help! For now, hard reset the MCU, try again.

I also corrupted the filesystem on the MCU at some point during testing, so proceed with caution if you care about your files.

All this suggests a couple of enhancements I need to put in place:

  • Ability to create new folders on the MCU because all the methods are in place, all it needs is a button or a menu.
  • Ability to "format" the MCU filesystem when things go wrong and it's the only thing one can do. I used code provided by fdushin on the micropython forum.
  • rename MCU files?

... So basically, I need to implement a context menu for file operations on the MCU side (edit, rename, delete, copy...) and maybe a "MCU operations" menu for things like format, flash, initialize...

Anyway, these are cosmetic, I'll try to work out what I'm doing wrong in my connection._write_steps_job() and report back.

Cheers,
Egor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions