More binary I/O problems

Charles Hixson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 9 00:25:54 PDT 2016



On 04/08/2016 09:25 PM, Basile B. via Digitalmars-d-learn wrote:
> On Saturday, 9 April 2016 at 03:15:58 UTC, Charles Hixson wrote:
>>
>>
>> On 04/08/2016 07:42 PM, Basile B. via Digitalmars-d-learn wrote:
>>> On Friday, 8 April 2016 at 20:58:06 UTC, Charles Hixson wrote:
>>>>> [...]
>>>> And that worked, but suddenly (after a compiler upgrade, did that 
>>>> matter? I'd also changed the program, though in ways that shouldn't 
>>>> have affected this.) it stopped working with the message:
>>>> let4a.d(138): Error: no [] operator overload for type Chnk
>>>>
>>>> [...]
>>>
>>> you can cast too (void*)
>>>
>> Thanks.  That syntax looks like it would work, but gee!  The syntax 
>> is getting worse and worse.
>> OTOH, I notice that you're using a file name rather than a File. 
>> Perhaps that's my problem,
>
> I've missed the first part of the topic, you can probably do it also 
> with a file. The point of the answer is just to show the cast.
>
>> but if so how do I specify that I want a binary read/write rather 
>> than a text one.  (I notice that you named the file "a.txt", and I 
>> explicitly do not want to do a text conversion.
>
> It's a binary file, the extension is meaningless.
>
Well, the extension is always meaningless except as a mnemonic.  But it 
appears that read/write aren't intended for use with fixed block files, 
so rawRead/rawWrite would be the better choice.



More information about the Digitalmars-d-learn mailing list