On Tue, Aug 02, 2022 at 11:10:27AM +0000, Alexander Zhirov via Digitalmars-d-learn wrote: [...] > ```d > auto result = db.query("select tcxs.settings_file as dbfile from > amts.t_client_xrdp_settings tcxs where tcxs.pid_client = ?", id); > ubyte[] bytes = cast(ubyte[])result.front()["dbfile"]; > write("newFile", bytes); > ```
Don't use `write` for binary data. Use instead File.rawWrite: ubyte[] data = ...; File f = File("dbfile", "w"); f.rawWrite(data[]); T -- This is a tpyo.