www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to Write Raw Bytes to Disk

reply "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> writes:
How do I write a byte[] in raw (unformatted) format to disk?

     File("f.raw", "wb").write(x)

doesn't seem to do it.

Why isn't the "wb" interpreted as raw bytes?
Feb 10 2015
parent "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> writes:
On Tuesday, 10 February 2015 at 11:03:06 UTC, Per Nordlöw wrote:
 How do I write a byte[] in raw (unformatted) format to disk?

     File("f.raw", "wb").write(x)

 doesn't seem to do it.

 Why isn't the "wb" interpreted as raw bytes?
Oops, I just discovered File("f.raw", "wb").rawWrite(x) .
Feb 10 2015