Thanks for the clarification @Dmitry. I tend to conflate bash and Linux
which is a mistake of course.
--
Onorio
On Thursday, May 12, 2016 at 4:26:03 AM UTC-4, Dmitry Belyaev wrote:
>
> The feature of expanding ~ belongs to bash, not Linux itself.
>
> On 7 May 2016 3:27:18 AM AEST, Onorio Cate
I think we are best served with two functions:
*read_bytes(file, start, bytes)*
*read_lines(file, start, lines)*
You an then optimize as required for each specific case
On Thursday, May 12, 2016 at 2:38:43 PM UTC+1, eksperimental wrote:
>
> I was thinking of delegating stuff to IO.read when de
I was thinking of delegating stuff to IO.read when dealing with lines
On Thu, 12 May 2016 15:08:15 +0200
José Valim wrote:
> Not in your example but if you want to do it per line, then yes.
>
> On Thursday, May 12, 2016, Charles Okwuagwu
> wrote:
>
> > def read(file, start, length) do
> > {
Not in your example but if you want to do it per line, then yes.
On Thursday, May 12, 2016, Charles Okwuagwu wrote:
> def read(file, start, length) do
> {ok, f} = :file.open(file, [:binary])
> * {ok**, data} = :file.pread(f, start,** length)*
> :file.close(f)
> dataend
>
> We are not read
def read(file, start, length) do
{ok, f} = :file.open(file, [:binary])
* {ok**, data} = :file.pread(f, start,** length)*
:file.close(f)
dataend
We are not reading the whole file, or are we? *:file.pread/3*
On Thursday, May 12, 2016 at 1:36:05 PM UTC+1, José Valim wrote:
>
> We need to c
We need to consider that performance wise they are quite different. We can
move the cursor when reading lines, we can't move the cursor when reading
bytes. We would actually need to load the file into Elixir. It would
probably be more interesting to add a File.position instead of hiding the
underly
Hi Charles,
thank you for your proposal.
I think it could be an interesting addition. But rather than just a
convenience function, make it behave more like its IO
conterpart: IO.read/2
Where you can pass the byte length, or :line.
Because sometimes is not about the bytes, but about the informatio
The feature of expanding ~ belongs to bash, not Linux itself.
On 7 May 2016 3:27:18 AM AEST, Onorio Catenacci wrote:
>Oh--that's good to know José. I had just assumed that Unix wouldn't
>have
>that issue since Windows seems to be such a fertile hunting ground for
>odd
>behaviors.
>
>On Fri, May