Re: converting carriage return

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Sun, 15 Jun 1997 17:39:21 -0700 D & B Edmunds <dae at PACLINK.COM>
writes:
>
>Hello to group!
>
>I am trying to encrypt a file, using a simple xor routine on each
>byte in it.
>I find that carriage return-line feed is not converted correctly using
>getc(),
>and can't figure out a fast way to do this.
>--snip
>    file_in = open("x.in", "r")  --file must exist
>    file_out = open("x.out","w") --output file

USE:
file_in = open("x.in", "rb")
file_out = open("x.out","wb")

Open the files in binary mode.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu