# Readlines() in v 0.5 and 0.6

**URL:** <https://discourse.julialang.org/t/readlines-in-v-0-5-and-0-6/1699>\
**Category:** General Usage\
**Created:** [January 26, 2017, 12:03pm UTC](https://discourse.julialang.org/t/readlines-in-v-0-5-and-0-6/1699 "2017-01-26T12:03:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [January 26, 2017, 12:03pm UTC](https://discourse.julialang.org/t/readlines-in-v-0-5-and-0-6/1699/1 "2017-01-26T12:03:21Z")

</div>

If I use `readlines(\`ls`)` in v 0.5 (precompiled binary) there is no problem, however in v 0.6 (Version 0.6.0-dev.2375) I get

```julia
> readlines(`ls`)
ERROR: MethodError: no method matching readlines(::Cmd)
Closest candidates are:
  readlines() at io.jl:214
  readlines(::AbstractString; chomp) at io.jl:210
  readlines(::IO; chomp) at io.jl:214

```

Now interestingly a help request in v 0.5 shows that there is no “method matching readlines(::Cmd)” either, but still it runs. I wonder if there has been a change in what is understood by an IOStream in the two versions of Julia, or the description of what the ::Cmd symbol does?

I tried adding a boolean for chomp but it did not like that either.  
What does the candidate readlines() with no expected argument do? It appears to be waiting for STDIN?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 26, 2017, 2:07pm UTC](https://discourse.julialang.org/t/readlines-in-v-0-5-and-0-6/1699/2 "2017-01-26T14:07:44Z")

</div>

This was changed in [https://github.com/JuliaLang/julia/pull/20203](https://github.com/JuliaLang/julia/pull/20203) … I think it may have been an unintentional change (the first argument to `readlines` was too strictly typed), and a PR to change it back would be welcome. (Also, better documentation.)

For now, you can still do

```julia
collect(eachline(`ls`))

```

Yes, `readlines()` with no arguments reads from `STDIN`.

---

<div class="post-metadata">

**Author:** ![Colin\_Beckingham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colin_beckingham/32/4878_2.png) [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Post date:** [January 26, 2017, 2:21pm UTC](https://discourse.julialang.org/t/readlines-in-v-0-5-and-0-6/1699/3 "2017-01-26T14:21:50Z")

</div>

Thank you for this feedback. FWIW I now have everything working again in both 0.5 and 0.6 using  
`split(chomp(readstring(...)))`  
so the engine is back on the rails.
