I'm wanting to get the magic number from a git packfile index to ensure that it is indeed a packfile. The pack format documentation states that the magic number is "/377tOc". When I open the packfile with Ruby for example, I get this back when reading the file:
> File.open("pack-4412d2306cfe9a0b6d1b9b4430abc767022e8a3c.idx").read(4)
=> "\377tOc"
But in Haskell I get this:
> h <- openFile "pack-4412d2306cfe9a0b6d1b9b4430abc767022e8a3c.idx" ReadMode
> Data.ByteString.hGet h 4
=> "\255tOc"
I take it I'm missing something obvious, but it's not clear to me what that is. What am I doing wrong here?