Comment on Show HN: Docker-phobia: Analyze Docker image size with a treemapparentComments−mr_mitm2yHow could curl detect where it's piped to?−take-five2ySomething like (in Python)os.isatty(sys.stdout.fileno())−Zambyte2yThat doesn't say where it's piped though. It could be redirected to a file, or piped to something harmless like jq.−timando2yIterate through /proc/<pid>/fd and check for the pipe id in the symlink target.
Comments
How could curl detect where it's piped to?
Something like (in Python)
os.isatty(sys.stdout.fileno())
That doesn't say where it's piped though. It could be redirected to a file, or piped to something harmless like jq.
Iterate through /proc/<pid>/fd and check for the pipe id in the symlink target.