1. EOF

------=_NextPart_001_0000_01C21917.873C66A0

I'm having a little problem reading certain kinds of files using getc(); =
I can read pure text files, and bitmap files that aren't 24-bit, but I ca=
n only read a very small first part of exe's, jpegs, gifs, 24-bit bmps.. =
nearly everything else.  Does this have anything to do with the way the E=
OF is determined?  Any suggestions on how to overcome it (getting length =
of file and keeping track??) ?

Any help appreciated,

NathanGet more from the Web.  FREE MSN Explorer download : http://explore=
r.msn.com

------=_NextPart_001_0000_01C21917.873C66A0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV>I'm having a l=
ittle problem reading certain kinds of files using getc(); I can read pur=
e text files, and bitmap files that aren't 24-bit, but I can only read a =
very small first part of exe's, jpegs, gifs, 24-bit bmps.. nearly everyth=
ing else.&nbsp;&nbsp;Does this have anything to do with the way the EOF i=
s determined?&nbsp; Any suggestions on how to overcome it (getting length=
 of file and keeping track??)&nbsp;?</DIV> <DIV>&nbsp;</DIV> <DIV>Any hel=
HTML><br clear=3Dall><hr>Get more from the Web.  FREE MSN Explorer downlo=
ad : <a href=3D'http://explorer.msn.com'>http://explorer.msn.com</a><br><=
/p>

------=_NextPart_001_0000_01C21917.873C66A0--

new topic     » topic index » view message » categorize

2. Re: EOF

Nathan wrote:

> I'm having a little problem reading certain kinds of files using getc();
> I can read pure text files, and bitmap files that aren't 24-bit, but I
> can only read a very small first part of exe's, jpegs, gifs, 24-bit
> bmps.. nearly everything else.  Does this have anything to do with the
> way the EOF is determined?

You're probably using "r" as the second parameter to open(). "r" is the
read-mode intended for text files and related things. This means that as
soon as your file hits a value of 26 (Control-Z) Euphoria thinks it's an
EOF.

> Any suggestions on how to overcome it (getting length of file and keeping
> track??) ?

Use "rb" [read binary] as the second parameter to open(). :)

Look here:
  http://www.rapideuphoria.com/lib_h_o.htm#open

Carl

new topic     » goto parent     » topic index » view message » categorize

3. Re: EOF

------=_NextPart_001_0001_01C21921.45050FD0


hah.. I feel stupid.  =20

Thanks

Nathan
----- Original Message -----
From: Carl W.
Subject: Re: EOF


Nathan wrote:

> I'm having a little problem reading certain kinds of files using getc()=
;
> I can read pure text files, and bitmap files that aren't 24-bit, but I
> can only read a very small first part of exe's, jpegs, gifs, 24-bit
> bmps.. nearly everything else.  Does this have anything to do with the
> way the EOF is determined?

You're probably using "r" as the second parameter to open(). "r" is the
read-mode intended for text files and related things. This means that as
soon as your file hits a value of 26 (Control-Z) Euphoria thinks it's an
EOF.

> Any suggestions on how to overcome it (getting length of file and keepi=
ng
> track??) ?

Use "rb" [read binary] as the second parameter to open(). :)

Look here:
  http://www.rapideuphoria.com/lib_h_o.htm#open

Carl



  FREE MSN Explorer download : http://explorer.msn.com

------=_NextPart_001_0001_01C21921.45050FD0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV>&nbsp;</DIV> <=
DIV>hah.. I feel stupid.&nbsp; </DIV> <DIV>&nbsp;</DIV> <DIV>Thanks</DIV>=
 <DIV>&nbsp;</DIV> <DIV>Nathan</DIV> <BLOCKQUOTE style=3D"PADDING-RIGHT: =
0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid;=
 MARGIN-RIGHT: 0px"> <DIV style=3D"FONT: 10pt Arial">----- Original Messa=
ge -----</DIV> <DIV style=3D"BACKGROUND: #e4e4e4; FONT: 10pt Arial; COLOR=
: black"><B>From:</B> Carl W.</DIV> <DIV style=3D"FONT: 10pt Arial"><B>Se=
nt:</B> Friday, June 21, 2002 12:05 PM</DIV> <DIV style=3D"FONT: 10pt Ari=
al"><B>To:</B> EUforum</DIV> <DIV style=3D"FONT: 10pt Arial"><B>Subject:<=
/B> Re: EOF</DIV> <DIV>&nbsp;</DIV>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D T=
he Euphoria Mailing List =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR><BR>Nath=
an wrote:<BR><BR>&gt; I'm having a little problem reading certain kinds o=
f files using getc();<BR>&gt; I can read pure text files, and bitmap file=
s that aren't 24-bit, but I<BR>&gt; can only read a very small first part=
 of exe's, jpegs, gifs, 24-bit<BR>&gt; bmps.. nearly everything else.&nbs=
p; Does this have anything to do with the<BR>&gt; way the EOF is determin=
ed?<BR><BR>You're probably using "r" as the second parameter to open(). "=
r" is the<BR>read-mode intended for text files and related things. This m=
eans that as<BR>soon as your file hits a value of 26 (Control-Z) Euphoria=
 thinks it's an<BR>EOF.<BR><BR>&gt; Any suggestions on how to overcome it=
 (getting length of file and keeping<BR>&gt; track??) ?<BR><BR>Use "rb" [=
read binary] as the second parameter to open(). :)<BR><BR>Look here:<BR>&=
nbsp; http://www.rapideuphoria.com/lib_h_o.htm#open<BR><BR>Carl<BR><BR>=3D=
=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<BR>This email was sent t=
o: encephalon1 at msn.com<BR><BR>EASY UNSUBSCRIBE click here: http://topica.=
com/u/?b1dd66.b2PHWj<BR>Or send an email to: EUforum-unsubscribe at topica.c=
om<BR><BR>T O P I C A -- Register now to manage your mail!<BR>http://www.=
topica.com/partner/tag02/register<BR>=3D=3D^=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
re from the Web.  FREE MSN Explorer download : <a href=3D'http://explorer=
.msn.com'>http://explorer.msn.com</a><br></p>

------=_NextPart_001_0001_01C21921.45050FD0--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu