Tobias S. Josefowitz wrote:
On Thu, Nov 17, 2016 at 11:37 AM, Stephen R. van den Berg srb@cuci.nl wrote:
Lance Dillon wrote:
Stdio.File fp;fp=Stdio.File(filename,"r");string str=fp->read(2);int res=array_sscanf(reverse(str),"%2c")[0];
Using %2c to read little endian probably only works on CPUs that are little endian to begin with.
"%c"
...
"-" Supplying a minus sign toggles the decoding to read the data encoded in little-endian byte order, rather than the default network (big-endian) byte order.
RTFM, thanks. Well, in any case, using Stdio.Buffer.sscanf() then still is the recommended way.