From: Robert McGovern Date: 2002-12-27T09:29:14+09:00 Subject: Re: Occasional Issue reading bytes of data > I have an issue where sometimes (20 times in 17,000 files) when I am > reading data from a file I don't get the value I expect. > > I am opening a file, reading the first 10 bytes and unpacking them as > Z3CCCCCCC. The issue appears that if one of the C values is 0x1A it is > read & unpacked as nil rather than 26. Found my problem, I needed to open the file in binary mode ("rb" - kinda fitting) for the bytes to be read in correctly. Why is it that Windows has a binary file mode? What is the effect of using the "b" flag on *nix platforms? is it simply ignored? Rob