Skip to content

readline not working for ls, but readlines work #28975

@need47

Description

@need47

julia version: 1.0.0

julia> readline(`ls`)
ERROR: MethodError: no method matching readline(::Cmd)
Closest candidates are:
  readline(::IOStream; keep) at iostream.jl:429
  readline() at io.jl:370
  readline(::AbstractString; keep) at io.jl:364
  ...
Stacktrace:
 [1] top-level scope at none:0
julia> readlines(`ls`)   # readlines work however. I don't see too much difference between the two.
27-element Array{String,1}:       
 "cpp"                             
 "cronjobs"                        
 ...                  
julia> readline("list")   # can read from file
"1468"

Metadata

Metadata

Assignees

No one assigned

    Labels

    ioInvolving the I/O subsystem: libuv, read, write, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions