Skip to content

FR. Using stdin as input #3

Description

@VasoVV

This is really the best solution to handle a *.vma outside of ProxMox.

But typically we face with compressed *.vma.gz format, so we have to write a BIG file twice:
*.vma.gz --> *.vma
*.vma --> *.raw

Actually we need a triple free disk space (vma.gz + vma + raw) at a time.

It would be perfect if the script has the ability to use stdin as input (as origin vma has), so we can use it in such a way:

zcat big.vma.gz | vma.py - /tmp/big-vma-extracted

Unfortunately named pipe doesn't work:

$ mkfifo blackhole
$ zcat big.vma.gz > blackhole &
$ vma.py blackhole /tmp/big-vma-extracted
[1]  + 237676 broken pipe  zcat big.vma.gz > blackhole
Traceback (most recent call last):
  File "vma.py", line 357, in <module>
    sys.exit(main())
  File "vma.py", line 352, in main
    extract(fo, args)
  File "vma.py", line 239, in extract
    fo.seek(0, os.SEEK_END)
io.UnsupportedOperation: File or stream is not seekable.

Thank you for your work!

Activity

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

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