Znik
Znik

Reputation: 1136

redirect file to stdout - reverse io redirection

I have some untypical trouble under linux and unsquashfs program.

Typically we redirect stdout to specified file, but I want something reverse. Redirect created on the fly file to stdout, without real file creation.

unsquashfs can extract specified file, but file is complete rewrited. This cause impossible named pipe using. It is needed for me because I want avoid creating temporary big extracted file that consumes space and IO. I must use output in command pipe. Unfortunately unsquashfs does not have '-' option for extracted file, similar to 'tar' or 'zip' command. It is possible what I want without unsquashfs fixing? It's any preload module or wrapping program or pseudofs with can I make reverse redirection?

Upvotes: 4

Views: 4410

Answers (1)

dnet
dnet

Reputation: 1429

You could use /dev/stdout and it works in some cases, however since it's still a pipe, it won't support some operations a file do (seeking for example), so it all depends on the program.

Upvotes: 4

Related Questions