in reply to Re^2: sysread/syswrite and O_DIRECT alignment problem (align)
in thread sysread/syswrite and O_DIRECT alignment problem

Yeah, I almost mentioned that "J" might not be the right choice. Previously I'd used "L", but I think there are also situations where that doesn't work. I almost switched to writing code to detect the system's endianness and just pull out the least-significant byte, but the possibility of a system with mixed endianness deterred me.

If I were to put this code someplace like a module I'd probably compare things like length pack "p", "foo" and length pack "J", 0 to pick which format letter to use with unpack.

- tye