Skip to content

Piping to head panics with broken pipe #759

@hseg

Description

@hseg

I'm trying to get the name of the first column from my file. I naively tried

xan head -j file.csv | head -n1

but over sufficient tries (I have a couple dozen such files I'm renaming this way), head closes fast enough that xan aborts with

thread 'main' panicked at library/std/src/io/stdio.rs:1165:9:
failed printing to stdout: Broken pipe (os error 32)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

See also: rust-lang/rust#46016, rust-lang/rust#97889

My particular usecase can be worked around by using

xan select 0 file.csv | xan head -j

instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions