I want to read binary file inNim-language. Because I want to work with WAV 

But I don't know how easy it is to read the first four bytes. This may be 
because I am not good at English.

I wrote the following code. However, nil is displayed.
    var hFile = open("example.wav", FileMode.fmWrite)
    # RIFF
    var buffer: pointer
    echo readBuffer(hFile, buffer, 4)
    echo repr(buffer)

How do I handle binary files? I would appreciate it if you could tell me.

Reply via email to