Skip to content

All files actions (remove and get)#88

Open
Sashkoiv wants to merge 3 commits into
scientifichackers:masterfrom
Sashkoiv:master
Open

All files actions (remove and get)#88
Sashkoiv wants to merge 3 commits into
scientifichackers:masterfrom
Sashkoiv:master

Conversation

@Sashkoiv
Copy link
Copy Markdown

@Sashkoiv Sashkoiv commented Jan 3, 2020

Sometimes I need to remove all files from the board, get all files or put all files to the board. Due to that,
I'm using those locally and pretty happy, so I'm suggesting small modifications to the original code.

Also for using vscode debugging I'm running the tool as a module and have added an extra record to .gitignore.

I'll appreciate any comments=)

oleksandr.ivanchuk added 3 commits October 30, 2019 17:07
Pass `--all` flag to retrieve files to the current directory
or specify the destination directory after the flag.
 - ampy --port /board/serial/port get --all
 - ampy --port /board/serial/port get --all ./destination/
To delete all files from the board:
  ampy --port /board/serial/port rm --all
@devxpy
Copy link
Copy Markdown
Member

devxpy commented Jan 22, 2020

To get all files, I would want to avoid adding a new option. Why not just do that if '/' is passed as the REMOTE_FILE argument?

$ ampy get /

Similarly, for the remove all command, this looks much more cleaner -

$ ampy rmdir /

@Sashkoiv
Copy link
Copy Markdown
Author

Hey @devxpy , good idea but not that obvious in my opinion.
Usually, people use commands like git add --all which is more informative for me.

@TonyLHansen
Copy link
Copy Markdown
Contributor

A better name for the option might be --recursive, which corresponds to the -R/-r/--recursive option found in the Unix/Linux commands rm and cp.

@TonyLHansen
Copy link
Copy Markdown
Contributor

I definitely prefer having an option rather than making "/" magic.

curiouswala added a commit that referenced this pull request Apr 16, 2026
)

PR #85 cherry-pick: add logging.debug() calls at the start of every
Files method (get, ls, mkdir, put, rm, rmdir, run). Logging is silent
by default and activates when the caller configures the 'ampy.files'
logger at DEBUG level. User-facing output (print) is unchanged.

PR #88 EISDIR decision: auto-falling back from rm to rmdir when a
directory is encountered was intentionally not implemented — it would
silently delete directory contents without user confirmation. The
existing "Is a directory (use rmdir to remove)" error is safer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants