Skip to content

Conversation

@drzraf
Copy link

@drzraf drzraf commented Jun 21, 2025

fix #9
based on (and replace) #129

Things like:

  • output redirection, eg: recoverable > /tmp/a.txt become possible (for any other command)
  • piping, eg: locate ... | grep foobar too
  • and combining of piping + redirection too, eg: help | grep z > /tmp/test.txt

The most painful part of the diff is switching from print() to return (so that Python output could be reused in subprocess.run()). Another option was to write the stdout write (intercepting print) but it sounded cumbersome.

@Lazza
Copy link
Owner

Lazza commented Jun 30, 2025

Thank you, this seems quite interesting, although I am getting several errors. I tried to run recoverable and first got an error related to list_parts, which I fixed by changing the line to this:

yield f"Partition #{i} -> {parts[part]}"

Now I am getting an error on the redirection part. Moreover, it seems that on Windows the file paths are being mangled, e.g. try to do this:

recoverable > C:\Users\name\Desktop\test.txt

It seems that Python is reading the backslash as an escape character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please allow dumping tree view of files of a partition to a file

2 participants