[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Reading from an empty file
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 5 Sep 2017 17:17:34 +0200
2017-09-05 15:13 GMT+02:00 Shmuel Zeigerman <shmuz@013net.net>:
> I wonder why the first read from an empty file returns nil rather than an
> empty string.
> E.g. fp:read(10) --> nil
>
> If the zero-sized file exists then it can be interpreted as a file
> containing an empty string (IMHO).
fp:read"a" will get you an empty string.