Re: Weird Problem with gets()

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

c.k.lester wrote:
> 
> I'm successfully getting a file number with
> 
>    fn = open( myfile, "r" )
> 
> fn is now 3.
> 
> I know the file has content, but when I try gets(fn), it is returning -1.
> 
> Any clue as to what might be happening?
> 
> The content of myfile is the EUforum RSS XML obtained using wget.

Hello c.k.

  Just as a guess (I don't have or use RSS).

What if you go,
integer fn
  object line
   fn = open( myfile, "r" )
   while 1 do
     line=gets(fn)
     puts(1,line&"\n")
   end while
  


   Does it print -1 repeatedly? 

   or just once and crash?

   If so the crash message should give you some clue.

Don Cole

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

Search



Quick Links

User menu

Not signed in.

Misc Menu