Re: Help - I'm at wit's end...
From: BRG (brg_at_nowhere.org)
Date: 12/30/04
- Next message: Phil Carmody: "Re: Yahoo: Quantum crypto vs. computing: thoughts?"
- Previous message: jstevh_at_msn.com: "Re: Surrogate factoring, revisited"
- Maybe in reply to: Don Bruder: "Help - I'm at wit's end..."
- Next in thread: Ben Pfaff: "Re: Help - I'm at wit's end..."
- Reply: Ben Pfaff: "Re: Help - I'm at wit's end..."
- Reply: Joe Peschel: "Re: Help - I'm at wit's end..."
- Reply: Phil Carmody: "Re: Help - I'm at wit's end..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 29 Dec 2004 23:18:59 +0000
Mike Scott wrote:
[snip]
>>>That was my next thought. However, if there's anything that has any
>>>chance to swap newlines for carriage returns, I can't find it. Add in
>>>the fact that this "inversion" *DOES NOT* happen when the exact same
>>>code (just called by a different mainline routine that gets its data
>>>from the FIPS test files rather than a ".torrent" file or its target))
>>>is handed the FIPS test vectors - when using the FIPS vectors, I get
>>>exactly the expected results - and I come up with "That's probably not
>>>it either".
>>
>>However in some OS's (e.g Windows) the main routine may need to be
>>different (or simply be different) for the two sorts of files since the
>>FIPS vectors are probably in a text file, for which fopen(filename, "r")
>>would need to be used to open the file, whereas the bit torrent file
>>would possibly be binary, which would require fopen(filename, "rb") in
>>order to read a binary file without special handling of the line ending
>>characters (I am assuming C code here).
>
> Actually its best to explicitly use "rt" or "rb" (t for text, b for binary).
> Use of "r" on its own is ambiguous - and the results depend on the compiler
> defaults. Most interpret "r" as "rt", but I am aware of at least one C
> compiler which interprets "r" as "rb".
Interesting - I was not aware that a 't' option existed - is this an
ANSI designated file opening mode?
Is it widely recognised (or silently ignored where it is unecessary)?
Brian Gladman
- Next message: Phil Carmody: "Re: Yahoo: Quantum crypto vs. computing: thoughts?"
- Previous message: jstevh_at_msn.com: "Re: Surrogate factoring, revisited"
- Maybe in reply to: Don Bruder: "Help - I'm at wit's end..."
- Next in thread: Ben Pfaff: "Re: Help - I'm at wit's end..."
- Reply: Ben Pfaff: "Re: Help - I'm at wit's end..."
- Reply: Joe Peschel: "Re: Help - I'm at wit's end..."
- Reply: Phil Carmody: "Re: Help - I'm at wit's end..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|